1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 16:20:17 +02:00

Merge branch 'master' into boehm-demers-weiser-gc

Conflicts:
	libguile/Makefile.am
	libguile/coop-defs.h
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-malloc.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc.c
	libguile/gc.h
	libguile/gc_os_dep.c
	libguile/hashtab.c
	libguile/hashtab.h
	libguile/inline.h
	libguile/private-gc.h
	libguile/struct.c
	libguile/struct.h
	libguile/threads.c
	libguile/threads.h
	libguile/vectors.h
	libguile/weaks.h
	test-suite/tests/gc.test
This commit is contained in:
Ludovic Courtès 2008-09-10 23:09:30 +02:00
commit 6f03035fe8
298 changed files with 15438 additions and 3275 deletions

View file

@ -10,12 +10,10 @@ compile
confdefs.h confdefs.h
config.build-subdirs config.build-subdirs
config.cache config.cache
config.guess
config.h config.h
config.h.in config.h.in
config.log config.log
config.status config.status
config.sub
configure configure
conftest conftest
conftest.c conftest.c
@ -24,6 +22,7 @@ elisp-comp
guile-*.tar.gz guile-*.tar.gz
guile-tools guile-tools
install-sh install-sh
lib
libtool libtool
ltconfig ltconfig
ltmain.sh ltmain.sh

7
.gitignore vendored
View file

@ -28,6 +28,7 @@ mdate-sh
install-sh install-sh
texinfo.tex texinfo.tex
*~ *~
,*
BUGS BUGS
Makefile Makefile
Makefile.in Makefile.in
@ -63,3 +64,9 @@ mkinstalldirs
pre-inst-guile pre-inst-guile
pre-inst-guile-env pre-inst-guile-env
stamp-h1 stamp-h1
guile-procedures.txt
guile-config/guile-config
guile-readline/guile-readline-config.h
guile-readline/guile-readline-config.h.in
TAGS
guile-1.8.pc

View file

504
COPYING.LESSER Normal file
View file

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

154
ChangeLog
View file

@ -1,3 +1,157 @@
2008-08-25 Ludovic Courtès <ludo@gnu.org>
* configure.in (GCC_CFLAGS): New variable. Store GCC flags like
`-Werror' inside it so that they are not used when compiling
Gnulib modules.
2008-08-21 Ludovic Courtès <ludo@gnu.org>
* autogen.sh: Don't use `gnulib-tool', use the Gnulib files
available in the repository.
2008-08-07 Neil Jerram <neil@ossau.uklinux.net>
* configure.in (SCM_I_GSC_STACK_GROWS_UP): Remove use of
AC_CACHE_CHECK, which was inadvertently causing
SCM_I_GSC_STACK_GROWS_UP _always_ to be 0.
2008-07-17 Neil Jerram <neil@ossau.uklinux.net>
* configure.in: Update stack direction test to be like that in
Autoconf _AC_LIBOBJ_ALLOCA and Gnulib; specifically in involving a
function calling itself.
2008-07-16 Ludovic Courtès <ludo@gnu.org>
* configure.in: Look for `struct dirent64' and `readdir64_r ()',
not available on HP-UX 11.11.
2008-07-06 Ludovic Courtès <ludo@gnu.org>
* configure.in: Update to Autoconf 2.61.
2008-06-28 Ludovic Courtès <ludo@gnu.org>
* configure.in: Use Automake with `-Wall -Wno-override'.
2008-05-07 Ludovic Courtès <ludo@gnu.org>
Guile 1.8.5 released.
* GUILE-VERSION (LIBGUILE_INTERFACE_CURRENT): Increment due to
the addition of an inlined version of `scm getc ()' and friends.
(LIBGUILE_INTERFACE_AGE): Increment.
(LIBGUILE_INTERFACE_REVISION): Zeroed.
(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION): Increment.
2008-05-04 Ludovic Courtès <ludo@gnu.org>
Add `pkg-config' support. Suggested by Aaron VanDevender, Greg
Troxel, and others.
* configure.in: Substitute `sitedir', produce `guile-1.8.pc'.
* Makefile.am (EXTRA_DIST): Add `guile-1.8.pc.in'.
(pkgconfigdir, pkgconfig_DATA): New.
2008-04-26 Ludovic Courtès <ludo@gnu.org>
* configure.in (BUILD_PTHREAD_SUPPORT): New Automake
conditional.
2008-04-26 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (EXTRA_DIST): Remove `ANON-CVS' and `SNAPSHOTS'.
2008-02-23 Neil Jerram <neil@ossau.uklinux.net>
* FAQ: New file.
* Makefile.am (EXTRA_DIST): Add FAQ
2008-02-22 Ludovic Courtès <ludo@gnu.org>
* configure.in: Check whether `strncasecmp' is declared.
2008-02-16 Ludovic Courtès <ludo@gnu.org>
Guile 1.8.4 released.
* GUILE-VERSION (LIBGUILE_INTERFACE_REVISION): Increment.
(GUILE_MICRO_VERSION): Increment.
* configure.in (GUILE_CFLAGS): Include `$CPPFLAGS' since they
may include required `-I' flags (e.g., `-I/path/to/gmp'), so
that "guile-config compile" reports all the needed flags.
2008-02-15 Neil Jerram <neil@ossau.uklinux.net>
* autogen.sh: Copy versions of config.guess and config.sub from
Guile CVS to build-aux and guile-readline.
2008-02-14 Neil Jerram <neil@ossau.uklinux.net>
* HACKING: Note need for libtool >= 1.5.26.
* config.rpath, build-aux/config.rpath: Updated to latest upstream
version.
* config.guess, config.sub: 2008-01-07 versions added to Guile
CVS, to ensure that Guile developers are using new enough versions
(in particular for AIX 6.1 support).
2008-02-11 Neil Jerram <neil@ossau.uklinux.net>
* configure.in (--without-64-calls): Use AC_MSG_CHECKING and
AC_MSG_RESULT instead of just echo.
(GUILE_I): New programs to try using _Complex_I or 1.0fi for the
imaginary unit.
2008-02-06 Neil Jerram <neil@ossau.uklinux.net>
* configure.in: Default to --without-64-calls for
powerpc-ibm-aix*. Thanks to Rainer Tammer for reporting that the
64 calls are a problem on that OS.
2008-02-06 Ludovic Courtès <ludo@gnu.org>
* NEWS: Mention Sun Studio compilation fix.
2008-02-05 Neil Jerram <neil@ossau.uklinux.net>
* configure.in (--without-64-calls): New option.
2008-01-30 Neil Jerram <neil@ossau.uklinux.net>
* pre-inst-guile.in (dyld_prefix), pre-inst-guile-env.in
(dyld_prefix): Construct and export dyld_prefix in a similar way
to ltdl_prefix, to allow pre-install dynamic linking to work on
MacOS. Thanks to Roger Mc Murtrie for reporting this problem.
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* LICENSE: Change COPYING.LIB to COPYING.LESSER.
* COPYING.LESSER: Renamed, previously COPYING.LIB.
* COPYING: Removed.
* libguile.h: Update copyright statement to LGPL.
2007-12-04 Ludovic Courtès <ludo@gnu.org>
* NEWS: Mention `accept' and `scm_c_{read,write}' bug fixes.
2007-12-03 Ludovic Courtès <ludo@gnu.org>
* NEWS: Add SRFI-69.
2007-10-24 Neil Jerram <neil@ossau.uklinux.net>
* .cvsignore: Add "lib".
* build-aux/.cvsignore: Add a load more generated files to ignore,
and commit to CVS.
2007-10-20 Ludovic Courtès <ludo@gnu.org> 2007-10-20 Ludovic Courtès <ludo@gnu.org>
* THANKS: Add Julian. * THANKS: Add Julian.

19
FAQ Normal file
View file

@ -0,0 +1,19 @@
Guile FAQ -*- outline -*-
* Build problems
** readline.c: error: `rl_pending_input' undeclared
This occurs if the Readline library detected by Guile's configure
script is actually the BSD Editline project's supposedly
Readline-compatible library. The immediate fix is to uninstall
Editline and install the real GNU Readline instead. When you do this,
please note that it probably won't work to keep Editline in /usr and
install GNU Readline in /usr/local (or some similar arrangement),
because the Editline library will then still be picked up at link and
run time; it's best (subject to other constraints) to remove Editline
completely.
For the longer term, please also report this problem to the Editline
project, to encourage them to fix it in the next release of their
Readline compatibility library.

209
HACKING
View file

@ -1,6 +1,6 @@
-*-text-*- -*-text-*-
Guile Hacking Guide Guile Hacking Guide
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free software Foundation, Inc. Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2008 Free software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the of this document as received, in any medium, provided that the
@ -66,7 +66,8 @@ Automake --- a system for automatically generating Makefiles that
libtool --- a system for managing the zillion hairy options needed libtool --- a system for managing the zillion hairy options needed
on various systems to produce shared libraries. Available in on various systems to produce shared libraries. Available in
"ftp://ftp.gnu.org/pub/gnu/libtool" "ftp://ftp.gnu.org/pub/gnu/libtool". Version 1.5.26 (or
later) is needed for correct AIX support.
gettext --- a system for rigging a program so that it can output its gettext --- a system for rigging a program so that it can output its
messages in the local tongue. Guile presently only exports messages in the local tongue. Guile presently only exports
@ -163,210 +164,6 @@ aclocal.m4, or any Makefile.in. Such patches are often large, and
we're just going to regenerate those files anyway. we're just going to regenerate those files anyway.
CVS conventions ======================================================
- We use CVS to manage the Guile sources. The repository lives on
subversions.gnu.org, in /cvs; you will need an
account on that machine to access the repository. Also, for security
reasons, subversions presently only supports CVS connections via the SSH
protocol, so you must first install the SSH client. Then, you should
set your CVS_RSH environment variable to ssh, and use the following as
your CVS root:
:ext:USER@subversions.gnu.org:/cvs
Either set your CVSROOT environment variable to that, or give it as
the value of the global -d option to CVS when you check out a working
directory.
For more information on SSH, see http://www.openssh.com.
The Guile sources live in several modules:
- guile-core --- the interpreter, QuickThreads, and ice-9
- guile-tcltk --- the Guile/Tk interface
- guile-tk --- the new Guile/Tk interface, based on STk's modified Tk
- guile-rgx-ctax --- the Guile/Rx interface, and the ctax implementation
- guile-scsh --- the port of SCSH to guile, talk to Gary Houston
- guile-www --- A Guile module for making HTTP requests.
- guile-statprof --- an experimental statistical profiler.
There is a mailing list for CVS commit messages; see README for details.
- The guile-core tree is now versioned similarly to the Linux kernel.
Guile now always uses three numbers to represent the version,
i.e. "1.6.5". The first number, 1, is the major version number, the
second number, 6, is the minor version number, and the third number,
5, is the micro version number. Changes in major version number
indicate major changes in Guile.
Minor version numbers that are even denote stable releases, and odd
minor version numbers denote development versions (which may be
unstable). The micro version number indicates a minor sub-revision of
a given MAJOR.MINOR release.
- A default CVS checkout will get the current unstable development
tree. However, for each stable release, a CVS branch is created so
that release (and ongoing maintenance) of the stable version can
proceed independent of the development of the next unstable version.
To check out a particular stable branch, you just need to specify "-r
branch_release-X-Y" to your CVS checkout command (or to any update).
For example, if you wanted to check out the 1.6 stable branch, you
would specify "-r branch_release-1-6".
So, for example, during a normal development cycle, work will proceed
on an unstable version, say 1.5.X, until it is decided that it's time
for a stable release. At that point, a branch named
branch_release-1-6 will be created, and the version numbers on the
HEAD of the CVS tree (the trunk, i.e. what you get by default), will
be changed to reflect the new unstable version 1.7.X. Then unstable
development will proceed on the unstable version, while the stable
1.5.X branch is fixed up for the eventual 1.6.0 release.
Anytime you want to yank an existing checked out tree to the stable
branch, you can run a command like this:
cvs -z3 update -r branch_release-1-6 -Pd
This will yank the working directory over on to the stable release
branch. Note that this directory will track that branch from then on
unless you do something to yank it back to the main (unstable) trunk.
To go back to the unstable branch, you can use
cvs -z3 update -A -Pd
Note that in either case, you should probably make sure you've
commited or removed all local changes before running the commands or
you're likely to have some unexpected results.
Finally note that one approach, should you need to work on both
branches, is to keep two trees checked out, one stable, the other
unstable and you can work in whichever is appropriate.
To save some initial bandwidth, you can check out either the stable
tree or the unstable tree, and then do something like this:
cp -a core-unstable core-1.5
cd core-1.5
cvs -z3 update -r branch_release-1-6 -Pd
- The stable and unstable CVS trees are distinct, and no changes will
automatically propagate between them. If you make changes that need
to show up both places, you'll need to apply the changes both places.
You *might* be able to do this with a cvs command, but often you'll
probably need to apply the changes by hand or risk migrating
superfluous modifications between the two versions. This is
particularly important when moving a change from the unstable branch
to the stable branch.
- In general, please don't be adventurous with the stable branch. We
mostly want bugfixes, documentation improvements, build improvements,
etc., though exceptions will doubtless exist.
- There are a few CVS tagging conventions which follow the Scheme
convention that dashes are used to separate words within a single
symbol, and so dashes bind more tightly than underscores. This means
that foo-bar_baz-bax indicates that foo-bar is somehow separate from
baz-bax. The conventions are as follows:
Branch root tags:
-----------------
anytime just before you create a branch it's a good
idea to create a normal tag so that you can refer to the branch point
on the main trunk as well as on the branch. So please use a tag of
the form
branch-root-release-1-X
or more generally, for other non-release branches:
branch-root_FOO
Branch tags:
------------
for the branch tag itself please use
branch_release-1-6
or more generally, for other non-release branches:
branch_FOO
Merge tags:
-----------
Whenever you're merging a branch back into the trunk (or into another
branch repeatedly) you need to tag the branch each time you merge. If
you don't do that, you won't be able to merge repeatedly without
possibly tedious conflicts. For those tags, we suggest:
branch-merge_SOME-FOO_to_SOME-BAR_1
branch-merge_SOME-FOO_to_SOME-BAR_2
..
As an example, SOME-BAR might be trunk, or even perhaps another branch
like branch-mvo-super-fixes :>
More mundanely, you might have
branch-merge_release-1-6_to_trunk_1
(Merging the stable branch to the trunk like this
will probably be much more common, when it happens, than the
reverse for the reasons mentioned above.
Release tags:
-------------
When releasing a new version of guile, please use:
release_X-Y-Z
i.e.
release_1-6-0
- If you hack on a stable branch, please apply any relevant patches or
fixes to the current unstable version (the main CVS trunk) as well.
Similarly, please back-port any important fixes to the unstable CVS
tree to the current stable branch.
- We check Makefile.am and configure.in files into CVS, but the
"autogen.sh" script must be run from the top-level to generate the
actual "configure" script that then must be run to create the various
Makefile-s to build guile. The general rule is that you should be able
to check out a working directory of Guile from CVS, and then type
"./autogen.sh", then "configure", and finally "make". No
automatically generated files should be checked into the CVS
repository.
- The .cvsignore file is contained in the repository, to provide a
reasonable list of auto-generated files that should not be checked in.
This, however, prohibits one from having local additions to the
.cvsignore file (yes, you can modify it and never check it in, but
that doesn't seem to be a good solution to me). To get around this
problem, you might want to patch your cvs program so that it uses a
.cvsignore-local file (say) instead of the one from the repository. A
patch for this can be found at the very end of this file.
- (Automake 1.4 only) Be sure to run automake at the top of the tree
with no arguments. Do not use `automake Makefile' to regenerate
specific Makefile.in files, and do not trust the Makefile rules to
rebuild them when they are out of date. Automake 1.4 will add
extraneous rules to the top-level Makefile if you specify specific
Makefiles to rebuild on the command line. Running the command
`autoreconf --force' should take care of everything correctly.
- Make sure your changes compile and work, at least on your own
machine, before checking them into the main branch of the Guile
repository. A good way for testing this is to run "make distcheck".
If you really need to check in untested changes, make a branch.
- Include each log entry in both the ChangeLog and in the CVS logs.
If you're using Emacs, the pcl-cvs interface to CVS has features to
make this easier; it checks the ChangeLog, and generates good default
CVS log entries from that.
Coding standards ===================================================== Coding standards =====================================================
- Before contributing larger amounts of code to Guile, please read the - Before contributing larger amounts of code to Guile, please read the

View file

@ -2,7 +2,7 @@ Installation Instructions
************************* *************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc. 2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it. unlimited permission to copy, distribute and modify it.
@ -67,6 +67,9 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came all sorts of other programs in order to regenerate files that came
with the distribution. with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options Compilers and Options
===================== =====================

View file

@ -1,2 +1,2 @@
Guile is covered under the terms of the GNU Lesser General Public Guile is covered under the terms of the GNU Lesser General Public
License, version 2.1. See COPYING.LIB. License, version 2.1. See COPYING.LESSER.

View file

@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
## ##
## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006, 2007 Free Software Foundation, Inc. ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006, 2007, 2008 Free Software Foundation, Inc.
## ##
## This file is part of GUILE. ## This file is part of GUILE.
## ##
@ -31,10 +31,8 @@ bin_SCRIPTS = guile-tools
include_HEADERS = libguile.h include_HEADERS = libguile.h
# automake sometimes forgets to distribute acconfig.h, EXTRA_DIST = LICENSE HACKING GUILE-VERSION \
# apparently depending on the phase of the moon. m4/ChangeLog FAQ guile-1.8.pc.in
EXTRA_DIST = LICENSE HACKING GUILE-VERSION ANON-CVS SNAPSHOTS \
m4/ChangeLog
TESTS = check-guile TESTS = check-guile
@ -42,4 +40,7 @@ ACLOCAL_AMFLAGS = -I guile-config -I m4
DISTCLEANFILES = check-guile.log DISTCLEANFILES = check-guile.log
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = guile-1.8.pc
# Makefile.am ends here # Makefile.am ends here

160
NEWS
View file

@ -1,5 +1,5 @@
Guile NEWS --- history of user-visible changes. Guile NEWS --- history of user-visible changes.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
See the end for copying conditions. See the end for copying conditions.
Please send Guile bug reports to bug-guile@gnu.org. Note that you Please send Guile bug reports to bug-guile@gnu.org. Note that you
@ -11,6 +11,7 @@ Changes in 1.9.0:
* New modules (see the manual for details) * New modules (see the manual for details)
** `(srfi srfi-18)', multithreading support
** The `(ice-9 i18n)' module provides internationalization support ** The `(ice-9 i18n)' module provides internationalization support
* Changes to the distribution * Changes to the distribution
@ -31,16 +32,173 @@ See `cancel-thread', `set-thread-cleanup!', and `thread-cleanup'.
* Changes to the C interface * Changes to the C interface
** Internal `scm_i_' functions now have "hidden" linkage with GCC/ELF
This makes these internal functions technically not callable from
application code.
** Functions for handling `scm_option' now no longer require an argument ** Functions for handling `scm_option' now no longer require an argument
indicating length of the `scm_t_option' array. indicating length of the `scm_t_option' array.
Changes in 1.8.6 (since 1.8.5)
* New features (see the manual for details)
** New convenience function `scm_c_symbol_length ()'
** Single stepping through code from Emacs
When you use GDS to evaluate Scheme code from Emacs, you can now use
`C-u' to indicate that you want to single step through that code. See
`Evaluating Scheme Code' in the manual for more details.
* Changes to the distribution
** Automake's `AM_MAINTAINER_MODE' is no longer used
Thus, the `--enable-maintainer-mode' configure option is no longer
available: Guile is now always configured in "maintainer mode".
* Bugs fixed
** `guile-config link' now prints `-L$libdir' before `-lguile'
** Fix memory corruption involving GOOPS' `class-redefinition'
** Fix possible deadlock in `mutex-lock'
** Fix build issue on Tru64 and ia64-hp-hpux11.23 (`SCM_UNPACK' macro)
** Fix build issue on mips, mipsel, powerpc and ia64 (stack direction)
** Fix build issue on hppa2.0w-hp-hpux11.11 (`dirent64' and `readdir64_r')
** Fix misleading output from `(help rationalize)'
** Fix build failure on Debian hppa architecture (bad stack growth detection)
Changes in 1.8.5 (since 1.8.4)
* Infrastructure changes
** Guile repository switched from CVS to Git
The new repository can be accessed using
"git-clone git://git.sv.gnu.org/guile.git", or can be browsed on-line at
http://git.sv.gnu.org/gitweb/?p=guile.git . See `README' for details.
** Add support for `pkg-config'
See "Autoconf Support" in the manual for details.
* New modules (see the manual for details)
** `(srfi srfi-88)'
* New features (see the manual for details)
** New `postfix' read option, for SRFI-88 keyword syntax
** Some I/O primitives have been inlined, which improves I/O performance
** New object-based traps infrastructure
This is a GOOPS-based infrastructure that builds on Guile's low-level
evaluator trap calls and facilitates the development of debugging
features like single-stepping, breakpoints, tracing and profiling.
See the `Traps' node of the manual for details.
** New support for working on Guile code from within Emacs
Guile now incorporates the `GDS' library (previously distributed
separately) for working on Guile code from within Emacs. See the
`Using Guile In Emacs' node of the manual for details.
* Bugs fixed
** `scm_add_slot ()' no longer segfaults (fixes bug #22369)
** Fixed `(ice-9 match)' for patterns like `((_ ...) ...)'
Previously, expressions like `(match '((foo) (bar)) (((_ ...) ...) #t))'
would trigger an unbound variable error for `match:andmap'.
** `(oop goops describe)' now properly provides the `describe' feature
** Fixed `args-fold' from `(srfi srfi-37)'
Previously, parsing short option names of argument-less options would
lead to a stack overflow.
** `(srfi srfi-35)' is now visible through `cond-expand'
** Fixed type-checking for the second argument of `eval'
** Fixed type-checking for SRFI-1 `partition'
** Fixed `struct-ref' and `struct-set!' on "light structs"
** Honor struct field access rights in GOOPS
** Changed the storage strategy of source properties, which fixes a deadlock
** Allow compilation of Guile-using programs in C99 mode with GCC 4.3 and later
** Fixed build issue for GNU/Linux on IA64
** Fixed build issues on NetBSD 1.6
** Fixed build issue on Solaris 2.10 x86_64
** Fixed build issue with DEC/Compaq/HP's compiler
** Fixed `scm_from_complex_double' build issue on FreeBSD
** Fixed `alloca' build issue on FreeBSD 6
** Removed use of non-portable makefile constructs
** Fixed shadowing of libc's <random.h> on Tru64, which broke compilation
** Make sure all tests honor `$TMPDIR'
* Changes to the distribution
** New FAQ
We've started collecting Frequently Asked Questions (FAQ), and will
distribute these (with answers!) in future Guile releases.
Changes in 1.8.4 (since 1.8.3) Changes in 1.8.4 (since 1.8.3)
* Bugs fixed * Bugs fixed
** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader ** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader
** Fixed a segmentation fault which occurred when displaying the
backtrace of a stack with a promise object (made by `delay') in it.
** Make `accept' leave guile mode while blocking
** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
** Fixed a build problem on AIX (use of func_data identifier)
** Fixed a segmentation fault which occurred when hashx-ref or hashx-set! was
called with an associator proc that returns neither a pair nor #f.
** Secondary threads now always return a valid module for (current-module).
** Avoid MacOS build problems caused by incorrect combination of "64"
system and library calls.
** `guile-snarf' now honors `$TMPDIR'
** `guile-config compile' now reports CPPFLAGS used at compile-time
** Fixed build with Sun Studio (Solaris 9)
** Fixed wrong-type-arg errors when creating zero length SRFI-4
uniform vectors on AIX.
** Fixed a deadlock that occurs upon GC with multiple threads.
** Fixed compile problem with GCC on Solaris and AIX (use of _Complex_I)
** Fixed autotool-derived build problems on AIX 6.1.
** Fixed NetBSD/alpha support
** Fixed MacOS build problem caused by use of rl_get_keymap(_name)
* New modules (see the manual for details)
** `(srfi srfi-69)'
* Documentation fixes and improvements
** Removed premature breakpoint documentation
The features described are not available in the series of 1.8.x
releases, so the documentation was misleading and has been removed.
** More about Guile's default *random-state* variable
** GOOPS: more about how to use `next-method'
* Changes to the distribution
** Corrected a few files that referred incorrectly to the old GPL + special exception licence
In fact Guile since 1.8.0 has been licensed with the GNU Lesser
General Public License, and the few incorrect files have now been
fixed to agree with the rest of the Guile distribution.
** Removed unnecessary extra copies of COPYING*
The distribution now contains a single COPYING.LESSER at its top level.
Changes in 1.8.3 (since 1.8.2) Changes in 1.8.3 (since 1.8.2)

28
README
View file

@ -1,5 +1,5 @@
!!! This is not a Guile release; it is a source tree retrieved via !!! This is not a Guile release; it is a source tree retrieved via
anonymous CVS or as a nightly snapshot at some random time after the Git or as a nightly snapshot at some random time after the
Guile 1.8 release. If this were a Guile release, you would not see Guile 1.8 release. If this were a Guile release, you would not see
this message. !!! [fixme: zonk on release] this message. !!! [fixme: zonk on release]
@ -364,14 +364,24 @@ guile-readline:
library on your system. library on your system.
doc: Documentation (see above). doc: Documentation (see above).
Anonymous CVS Access and FTP snapshots =============================== Git Repository Access ================================================
We make the developers' working Guile sources available via anonymous Guile's source code is stored in a Git repository at Savannah. Anyone
CVS, and by nightly snapshots, accessible via FTP. See the files can access it using `git-clone' from one of the following URLs:
`ANON-CVS' and `SNAPSHOTS' for details.
If you would like to receive mail when people commit changes to the git://git.sv.gnu.org/guile.git
Guile CVS repository, you can subscribe to guile-cvs@gnu.org by the http://git.sv.gnu.org/r/guile.git
Mailman mailing list interface at
<http://mail.gnu.org/mailman/listinfo/guile-cvs> Developers with a Savannah SSH account can also access it from:
ssh://git.sv.gnu.org/srv/git/guile.git
The repository can also be browsed on-line at the following address:
http://git.sv.gnu.org/gitweb/?p=guile.git
For more information on Git, please see:
http://git.or.cz/
Please send problem reports to <bug-guile@gnu.org>.

View file

@ -1,26 +0,0 @@
When Guile is obtained from CVS, a few extra steps must be taken
before the usual configure, make, make install. You will need to have
up-to-date versions of the tools listed in HACKING (see below),
correctly installed. i.e., they must be found in the current PATH and
not shadowed or otherwise broken by files left behind from other
versions.
"up-to-date" means the latest released versions at the time that Guile
was obtained from CVS. Sometimes older or newer versions will work.
In addition to the guile/guile-core module that holds the main
sources, you also need the two modules guile/guile-scripts and
guile/workbook. For example, you can use this command to check out
all three modules:
$ cvs -d:ext:anoncvs@savannah.gnu.org:/cvsroot/guile \
co guile/guile-core guile/guile-scripts guile/workbook
Then you must run the autogen.sh script in guile/guile-core:
$ cd guile/guile-core
$ ./autogen.sh
For more information about hacking Guile and some troubleshooting
hints, see the file HACKING. It can be found in guile/guile-core and
guile/workbook/build/dist-files/.

14
THANKS
View file

@ -2,6 +2,7 @@ Contributors since the last release:
Rob Browning Rob Browning
Ludovic Courtès Ludovic Courtès
Julian Graham
Stefan Jahn Stefan Jahn
Neil Jerram Neil Jerram
Antoine Mathys Antoine Mathys
@ -27,6 +28,7 @@ For fixes or providing information which led to a fix:
Stephen Compall Stephen Compall
Brian Crowder Brian Crowder
Christopher Cramer Christopher Cramer
David Diffenbaugh
Hyper Division Hyper Division
Alexandre Duret-Lutz Alexandre Duret-Lutz
Nils Durner Nils Durner
@ -35,12 +37,14 @@ For fixes or providing information which led to a fix:
Charles Gagnon Charles Gagnon
Peter Gavin Peter Gavin
Eric Gillespie, Jr Eric Gillespie, Jr
Didier Godefroy
John Goerzen John Goerzen
Mike Gran Mike Gran
Szavai Gyula Szavai Gyula
Sven Hartrumpf Sven Hartrumpf
Eric Hanchrow Eric Hanchrow
Sam Hocevar Sam Hocevar
Patrick Horgan
Ales Hvezda Ales Hvezda
Peter Ivanyi Peter Ivanyi
Wolfgang Jaehrling Wolfgang Jaehrling
@ -49,17 +53,23 @@ For fixes or providing information which led to a fix:
Steve Juranich Steve Juranich
Richard Kim Richard Kim
Bruce Korb Bruce Korb
René Köcher
Matthias Köppe Matthias Köppe
Matt Kraai Matt Kraai
Miroslav Lichvar Miroslav Lichvar
Jeff Long Jeff Long
Marco Maggi Marco Maggi
Gregory Marton
Antoine Mathys
Dan McMahill Dan McMahill
Roger Mc Murtrie
Tim Mooney
Han-Wen Nienhuys Han-Wen Nienhuys
Jan Nieuwenhuizen Jan Nieuwenhuizen
Hrvoje Nikšić Hrvoje Nikšić
Stefan Nordhausen Stefan Nordhausen
Roland Orre Roland Orre
Peter O'Gorman
Pieter Pareit Pieter Pareit
Jack Pavlovsky Jack Pavlovsky
Arno Peters Arno Peters
@ -71,14 +81,18 @@ For fixes or providing information which led to a fix:
Hugh Sasse Hugh Sasse
Werner Scheinast Werner Scheinast
Bill Schottstaedt Bill Schottstaedt
Frank Schwidom
Thiemo Seufer
Scott Shedden Scott Shedden
Alex Shinn Alex Shinn
Daniel Skarda Daniel Skarda
Cesar Strauss Cesar Strauss
Rainer Tammer
Richard Todd Richard Todd
Issac Trotts Issac Trotts
Greg Troxel Greg Troxel
Aaron M. Ucko Aaron M. Ucko
Stephen Uitti
Momchil Velikov Momchil Velikov
Panagiotis Vossos Panagiotis Vossos
Neil W. Van Dyke Neil W. Van Dyke

View file

@ -19,17 +19,19 @@ libtool --version
echo "" echo ""
${M4:-/usr/bin/m4} --version ${M4:-/usr/bin/m4} --version
echo "" echo ""
gnulib-tool --version
echo ""
###################################################################### ######################################################################
### update infrastructure ### update infrastructure
gnulib-tool --update && \
autoreconf -i --force --verbose autoreconf -i --force --verbose
echo "guile-readline..." echo "guile-readline..."
(cd guile-readline && ./autogen.sh) (cd guile-readline && ./autogen.sh)
# Copy versions of config.guess and config.sub from Guile's repository to
# build-aux and guile-readline.
cp -f config.guess config.sub build-aux/
cp -f config.guess config.sub guile-readline/
echo "Now run configure and make." echo "Now run configure and make."
echo "You must pass the \`--enable-maintainer-mode' option to configure." echo "You must pass the \`--enable-maintainer-mode' option to configure."

View file

@ -1,3 +1,12 @@
2008-04-17 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (SCM_BENCHMARKS): Add `benchmarks/read.bm'.
* benchmarks/read.bm: New file.
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* COPYING: Removed.
2006-11-17 Neil Jerram <neil@ossau.uklinux.net> 2006-11-17 Neil Jerram <neil@ossau.uklinux.net>
* README: Note need for subscription to bug-guile@gnu.org. * README: Note need for subscription to bug-guile@gnu.org.

View file

@ -1,6 +1,7 @@
SCM_BENCHMARKS = benchmarks/0-reference.bm \ SCM_BENCHMARKS = benchmarks/0-reference.bm \
benchmarks/continuations.bm \ benchmarks/continuations.bm \
benchmarks/if.bm \ benchmarks/if.bm \
benchmarks/logand.bm benchmarks/logand.bm \
benchmarks/read.bm
EXTRA_DIST = guile-benchmark lib.scm $(SCM_BENCHMARKS) EXTRA_DIST = guile-benchmark lib.scm $(SCM_BENCHMARKS)

View file

@ -0,0 +1,62 @@
;;; read.bm --- Exercise the reader. -*- Scheme -*-
;;;
;;; Copyright (C) 2008 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 software; see the file COPYING. If not, write to
;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;;; Boston, MA 02110-1301 USA
(define-module (benchmarks read)
:use-module (benchmark-suite lib))
(define %files-to-load
;; Various large Scheme files.
(map %search-load-path
'("ice-9/boot-9.scm" "ice-9/common-list.scm"
"ice-9/format.scm" "ice-9/optargs.scm"
"ice-9/session.scm" "ice-9/getopt-long.scm"
"ice-9/psyntax.pp")))
(define (load-file-with-reader file-name reader buffering)
(with-input-from-file file-name
(lambda ()
(apply setvbuf (current-input-port) buffering)
(let loop ((sexp (reader)))
(if (eof-object? sexp)
#t
(loop (reader)))))))
(define (exercise-read buffering)
(for-each (lambda (file)
(load-file-with-reader file read buffering))
%files-to-load))
(with-benchmark-prefix "read"
(benchmark "_IONBF" 5 ;; this one is very slow
(exercise-read (list _IONBF)))
(benchmark "_IOLBF" 100
(exercise-read (list _IOLBF)))
(benchmark "_IOFBF 4096" 100
(exercise-read (list _IOFBF 4096)))
(benchmark "_IOFBF 8192" 100
(exercise-read (list _IOFBF 8192)))
(benchmark "_IOFBF 16384" 100
(exercise-read (list _IOFBF 16384))))

13
build-aux/.cvsignore Normal file
View file

@ -0,0 +1,13 @@
.deps
.dirstamp
link-warning.h
compile
config.guess
config.sub
depcomp
elisp-comp
install-sh
ltmain.sh
mdate-sh
missing
texinfo.tex

1
build-aux/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
link-warning.h

View file

@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the # Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable. # run time search path of shared libraries in an executable.
# #
# Copyright 1996-2006 Free Software Foundation, Inc. # Copyright 1996-2008 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001 # Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #
@ -64,7 +64,7 @@ else
;; ;;
esac esac
;; ;;
mingw* | pw32* | os2*) mingw* | cygwin* | pw32* | os2*)
;; ;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
wl='-Wl,' wl='-Wl,'
@ -74,7 +74,7 @@ else
;; ;;
newsos6) newsos6)
;; ;;
linux*) linux* | k*bsd*-gnu)
case $cc_basename in case $cc_basename in
icc* | ecc*) icc* | ecc*)
wl='-Wl,' wl='-Wl,'
@ -100,7 +100,7 @@ else
osf3* | osf4* | osf5*) osf3* | osf4* | osf5*)
wl='-Wl,' wl='-Wl,'
;; ;;
sco3.2v5*) rdos*)
;; ;;
solaris*) solaris*)
wl='-Wl,' wl='-Wl,'
@ -108,11 +108,14 @@ else
sunos4*) sunos4*)
wl='-Qoption ld ' wl='-Qoption ld '
;; ;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,' wl='-Wl,'
;; ;;
sysv4*MP*) sysv4*MP*)
;; ;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*) unicos*)
wl='-Wl,' wl='-Wl,'
;; ;;
@ -155,7 +158,7 @@ if test "$with_gnu_ld" = yes; then
# option of GNU ld is called -rpath, not --rpath. # option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in case "$host_os" in
aix3* | aix4* | aix5*) aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken # On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then if test "$host_cpu" != ia64; then
ld_shlibs=no ld_shlibs=no
@ -189,11 +192,11 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no ld_shlibs=no
fi fi
;; ;;
interix3*) interix[3-9]*)
hardcode_direct=no hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir' hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;; ;;
linux*) gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
: :
else else
@ -251,7 +254,7 @@ else
hardcode_direct=unsupported hardcode_direct=unsupported
fi fi
;; ;;
aix4* | aix5*) aix[4-9]*)
if test "$host_cpu" = ia64; then if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't # On IA64, the linker does run time linking by default, so we don't
# have to do anything special. # have to do anything special.
@ -261,7 +264,7 @@ else
# Test if we are trying to use run time linking or normal # Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we # AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking. # need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*) case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes aix_use_runtimelinking=yes
@ -280,7 +283,7 @@ else
strings "$collect2name" | grep resolve_lib_name >/dev/null strings "$collect2name" | grep resolve_lib_name >/dev/null
then then
# We have reworked collect2 # We have reworked collect2
hardcode_direct=yes :
else else
# We have old collect2 # We have old collect2
hardcode_direct=unsupported hardcode_direct=unsupported
@ -359,7 +362,7 @@ else
hardcode_direct=yes hardcode_direct=yes
hardcode_minus_L=yes hardcode_minus_L=yes
;; ;;
freebsd* | kfreebsd*-gnu | dragonfly*) freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir' hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes hardcode_direct=yes
;; ;;
@ -412,6 +415,7 @@ else
hardcode_libdir_separator=: hardcode_libdir_separator=:
;; ;;
openbsd*) openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir' hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@ -425,6 +429,9 @@ else
;; ;;
esac esac
fi fi
else
ld_shlibs=no
fi
;; ;;
os2*) os2*)
hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_flag_spec='-L$libdir'
@ -471,7 +478,7 @@ else
ld_shlibs=yes ld_shlibs=yes
fi fi
;; ;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;; ;;
sysv5* | sco3.2v5* | sco5v6*) sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
@ -488,33 +495,51 @@ fi
# Check dynamic linker characteristics # Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name' libname_spec='lib$name'
case "$host_os" in case "$host_os" in
aix3*) aix3*)
library_names_spec='$libname.a'
;; ;;
aix4* | aix5*) aix[4-9]*)
library_names_spec='$libname$shrext'
;; ;;
amigaos*) amigaos*)
library_names_spec='$libname.a'
;; ;;
beos*) beos*)
library_names_spec='$libname$shrext'
;; ;;
bsdi[45]*) bsdi[45]*)
library_names_spec='$libname$shrext'
;; ;;
cygwin* | mingw* | pw32*) cygwin* | mingw* | pw32*)
shrext=.dll shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
shrext=.dylib shrext=.dylib
library_names_spec='$libname$shrext'
;; ;;
dgux*) dgux*)
library_names_spec='$libname$shrext'
;; ;;
freebsd1*) freebsd1*)
;; ;;
kfreebsd*-gnu)
;;
freebsd* | dragonfly*) freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;; ;;
gnu*) gnu*)
library_names_spec='$libname$shrext'
;; ;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
case $host_cpu in case $host_cpu in
@ -528,10 +553,13 @@ case "$host_os" in
shrext=.sl shrext=.sl
;; ;;
esac esac
library_names_spec='$libname$shrext'
;; ;;
interix3*) interix[3-9]*)
library_names_spec='$libname$shrext'
;; ;;
irix5* | irix6* | nonstopux*) irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in case "$host_os" in
irix5* | nonstopux*) irix5* | nonstopux*)
libsuff= shlibsuff= libsuff= shlibsuff=
@ -548,41 +576,59 @@ case "$host_os" in
;; ;;
linux*oldld* | linux*aout* | linux*coff*) linux*oldld* | linux*aout* | linux*coff*)
;; ;;
linux*) linux* | k*bsd*-gnu)
library_names_spec='$libname$shrext'
;; ;;
knetbsd*-gnu) knetbsd*-gnu)
library_names_spec='$libname$shrext'
;; ;;
netbsd*) netbsd*)
library_names_spec='$libname$shrext'
;; ;;
newsos6) newsos6)
library_names_spec='$libname$shrext'
;; ;;
nto-qnx*) nto-qnx*)
library_names_spec='$libname$shrext'
;; ;;
openbsd*) openbsd*)
library_names_spec='$libname$shrext$versuffix'
;; ;;
os2*) os2*)
libname_spec='$name' libname_spec='$name'
shrext=.dll shrext=.dll
library_names_spec='$libname.a'
;; ;;
osf3* | osf4* | osf5*) osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;; ;;
solaris*) solaris*)
library_names_spec='$libname$shrext'
;; ;;
sunos4*) sunos4*)
library_names_spec='$libname$shrext$versuffix'
;; ;;
sysv4 | sysv4.3*) sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;; ;;
sysv4*MP*) sysv4*MP*)
library_names_spec='$libname$shrext'
;; ;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;; ;;
uts4*) uts4*)
library_names_spec='$libname$shrext'
;; ;;
esac esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g' sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'` shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
@ -596,6 +642,12 @@ libext="$libext"
# Shared library suffix (normally "so"). # Shared library suffix (normally "so").
shlibext="$shlibext" shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking. # Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist. # This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec" hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"

28
build-aux/link-warning.h Normal file
View file

@ -0,0 +1,28 @@
/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
a linker warning on most glibc systems.
We use a linker warning rather than a preprocessor warning, because
#warning cannot be used inside macros. */
#ifndef GL_LINK_WARNING
/* This works on platforms with GNU ld and ELF object format.
Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
Testing __ELF__ guarantees the ELF object format.
Testing __GNUC__ is necessary for the compound expression syntax. */
# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
# define GL_LINK_WARNING(message) \
GL_LINK_WARNING1 (__FILE__, __LINE__, message)
# define GL_LINK_WARNING1(file, line, message) \
GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */
# define GL_LINK_WARNING2(file, line, message) \
GL_LINK_WARNING3 (file ":" #line ": warning: " message)
# define GL_LINK_WARNING3(message) \
({ static const char warning[sizeof (message)] \
__attribute__ ((__unused__, \
__section__ (".gnu.warning"), \
__aligned__ (1))) \
= message "\n"; \
(void)0; \
})
# else
# define GL_LINK_WARNING(message) ((void) 0)
# endif
#endif

1526
config.guess vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the # Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable. # run time search path of shared libraries in an executable.
# #
# Copyright 1996-2006 Free Software Foundation, Inc. # Copyright 1996-2008 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001 # Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# #
@ -64,7 +64,7 @@ else
;; ;;
esac esac
;; ;;
mingw* | pw32* | os2*) mingw* | cygwin* | pw32* | os2*)
;; ;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
wl='-Wl,' wl='-Wl,'
@ -74,7 +74,7 @@ else
;; ;;
newsos6) newsos6)
;; ;;
linux*) linux* | k*bsd*-gnu)
case $cc_basename in case $cc_basename in
icc* | ecc*) icc* | ecc*)
wl='-Wl,' wl='-Wl,'
@ -100,7 +100,7 @@ else
osf3* | osf4* | osf5*) osf3* | osf4* | osf5*)
wl='-Wl,' wl='-Wl,'
;; ;;
sco3.2v5*) rdos*)
;; ;;
solaris*) solaris*)
wl='-Wl,' wl='-Wl,'
@ -108,11 +108,14 @@ else
sunos4*) sunos4*)
wl='-Qoption ld ' wl='-Qoption ld '
;; ;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,' wl='-Wl,'
;; ;;
sysv4*MP*) sysv4*MP*)
;; ;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*) unicos*)
wl='-Wl,' wl='-Wl,'
;; ;;
@ -155,7 +158,7 @@ if test "$with_gnu_ld" = yes; then
# option of GNU ld is called -rpath, not --rpath. # option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in case "$host_os" in
aix3* | aix4* | aix5*) aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken # On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then if test "$host_cpu" != ia64; then
ld_shlibs=no ld_shlibs=no
@ -189,11 +192,11 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no ld_shlibs=no
fi fi
;; ;;
interix3*) interix[3-9]*)
hardcode_direct=no hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir' hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;; ;;
linux*) gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
: :
else else
@ -251,7 +254,7 @@ else
hardcode_direct=unsupported hardcode_direct=unsupported
fi fi
;; ;;
aix4* | aix5*) aix[4-9]*)
if test "$host_cpu" = ia64; then if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't # On IA64, the linker does run time linking by default, so we don't
# have to do anything special. # have to do anything special.
@ -261,7 +264,7 @@ else
# Test if we are trying to use run time linking or normal # Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we # AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking. # need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*) case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes aix_use_runtimelinking=yes
@ -280,7 +283,7 @@ else
strings "$collect2name" | grep resolve_lib_name >/dev/null strings "$collect2name" | grep resolve_lib_name >/dev/null
then then
# We have reworked collect2 # We have reworked collect2
hardcode_direct=yes :
else else
# We have old collect2 # We have old collect2
hardcode_direct=unsupported hardcode_direct=unsupported
@ -359,7 +362,7 @@ else
hardcode_direct=yes hardcode_direct=yes
hardcode_minus_L=yes hardcode_minus_L=yes
;; ;;
freebsd* | kfreebsd*-gnu | dragonfly*) freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir' hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes hardcode_direct=yes
;; ;;
@ -412,6 +415,7 @@ else
hardcode_libdir_separator=: hardcode_libdir_separator=:
;; ;;
openbsd*) openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir' hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@ -425,6 +429,9 @@ else
;; ;;
esac esac
fi fi
else
ld_shlibs=no
fi
;; ;;
os2*) os2*)
hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_flag_spec='-L$libdir'
@ -471,7 +478,7 @@ else
ld_shlibs=yes ld_shlibs=yes
fi fi
;; ;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;; ;;
sysv5* | sco3.2v5* | sco5v6*) sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
@ -488,33 +495,51 @@ fi
# Check dynamic linker characteristics # Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name' libname_spec='lib$name'
case "$host_os" in case "$host_os" in
aix3*) aix3*)
library_names_spec='$libname.a'
;; ;;
aix4* | aix5*) aix[4-9]*)
library_names_spec='$libname$shrext'
;; ;;
amigaos*) amigaos*)
library_names_spec='$libname.a'
;; ;;
beos*) beos*)
library_names_spec='$libname$shrext'
;; ;;
bsdi[45]*) bsdi[45]*)
library_names_spec='$libname$shrext'
;; ;;
cygwin* | mingw* | pw32*) cygwin* | mingw* | pw32*)
shrext=.dll shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;; ;;
darwin* | rhapsody*) darwin* | rhapsody*)
shrext=.dylib shrext=.dylib
library_names_spec='$libname$shrext'
;; ;;
dgux*) dgux*)
library_names_spec='$libname$shrext'
;; ;;
freebsd1*) freebsd1*)
;; ;;
kfreebsd*-gnu)
;;
freebsd* | dragonfly*) freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;; ;;
gnu*) gnu*)
library_names_spec='$libname$shrext'
;; ;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
case $host_cpu in case $host_cpu in
@ -528,10 +553,13 @@ case "$host_os" in
shrext=.sl shrext=.sl
;; ;;
esac esac
library_names_spec='$libname$shrext'
;; ;;
interix3*) interix[3-9]*)
library_names_spec='$libname$shrext'
;; ;;
irix5* | irix6* | nonstopux*) irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in case "$host_os" in
irix5* | nonstopux*) irix5* | nonstopux*)
libsuff= shlibsuff= libsuff= shlibsuff=
@ -548,41 +576,59 @@ case "$host_os" in
;; ;;
linux*oldld* | linux*aout* | linux*coff*) linux*oldld* | linux*aout* | linux*coff*)
;; ;;
linux*) linux* | k*bsd*-gnu)
library_names_spec='$libname$shrext'
;; ;;
knetbsd*-gnu) knetbsd*-gnu)
library_names_spec='$libname$shrext'
;; ;;
netbsd*) netbsd*)
library_names_spec='$libname$shrext'
;; ;;
newsos6) newsos6)
library_names_spec='$libname$shrext'
;; ;;
nto-qnx*) nto-qnx*)
library_names_spec='$libname$shrext'
;; ;;
openbsd*) openbsd*)
library_names_spec='$libname$shrext$versuffix'
;; ;;
os2*) os2*)
libname_spec='$name' libname_spec='$name'
shrext=.dll shrext=.dll
library_names_spec='$libname.a'
;; ;;
osf3* | osf4* | osf5*) osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;; ;;
solaris*) solaris*)
library_names_spec='$libname$shrext'
;; ;;
sunos4*) sunos4*)
library_names_spec='$libname$shrext$versuffix'
;; ;;
sysv4 | sysv4.3*) sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;; ;;
sysv4*MP*) sysv4*MP*)
library_names_spec='$libname$shrext'
;; ;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;; ;;
uts4*) uts4*)
library_names_spec='$libname$shrext'
;; ;;
esac esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g' sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'` shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
@ -596,6 +642,12 @@ libext="$libext"
# Shared library suffix (normally "so"). # Shared library suffix (normally "so").
shlibext="$shlibext" shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking. # Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist. # This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec" hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"

1654
config.sub vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@ dnl
define(GUILE_CONFIGURE_COPYRIGHT,[[ define(GUILE_CONFIGURE_COPYRIGHT,[[
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GUILE This file is part of GUILE
@ -25,7 +25,7 @@ Boston, MA 02110-1301, USA.
]]) ]])
AC_PREREQ(2.59) AC_PREREQ(2.61)
dnl `patsubst' here deletes the newline which "echo" prints. We can't use dnl `patsubst' here deletes the newline which "echo" prints. We can't use
dnl "echo -n" since -n is not portable (see autoconf manual "Limitations of dnl "echo -n" since -n is not portable (see autoconf manual "Limitations of
@ -41,15 +41,14 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(GUILE-VERSION) AC_CONFIG_SRCDIR(GUILE-VERSION)
AM_INIT_AUTOMAKE([gnu no-define check-news]) AM_INIT_AUTOMAKE([gnu no-define check-news -Wall -Wno-override])
AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT) AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT)
AC_CONFIG_SRCDIR([GUILE-VERSION]) AC_CONFIG_SRCDIR([GUILE-VERSION])
. $srcdir/GUILE-VERSION . $srcdir/GUILE-VERSION
AM_MAINTAINER_MODE AC_CONFIG_HEADERS([config.h])
AM_CONFIG_HEADER([config.h])
AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/) AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -62,8 +61,11 @@ AC_CONFIG_SUBDIRS(guile-readline)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
AC_LANG([C])
dnl Some more checks for Win32 dnl Some more checks for Win32
AC_CYGWIN AC_CANONICAL_HOST
AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_WIN32_DLL
AC_PROG_INSTALL AC_PROG_INSTALL
@ -75,7 +77,8 @@ AC_PROG_AWK
dnl Gnulib. dnl Gnulib.
gl_INIT gl_INIT
AM_PROG_CC_STDC AC_PROG_CC_C89
# for per-target cflags in the libguile subdir # for per-target cflags in the libguile subdir
AM_PROG_CC_C_O AM_PROG_CC_C_O
@ -124,7 +127,7 @@ AC_ARG_ENABLE(debug-malloc,
SCM_I_GSC_GUILE_DEBUG=0 SCM_I_GSC_GUILE_DEBUG=0
AC_ARG_ENABLE(guile-debug, AC_ARG_ENABLE(guile-debug,
[AC_HELP_STRING([--enable-guile-debug], [AS_HELP_STRING([--enable-guile-debug],
[include internal debugging functions])], [include internal debugging functions])],
if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
SCM_I_GSC_GUILE_DEBUG=1 SCM_I_GSC_GUILE_DEBUG=1
@ -143,7 +146,7 @@ AC_ARG_ENABLE(regex,
enable_regex=yes) enable_regex=yes)
AC_ARG_ENABLE([discouraged], AC_ARG_ENABLE([discouraged],
AC_HELP_STRING([--disable-discouraged],[omit discouraged features])) AS_HELP_STRING([--disable-discouraged],[omit discouraged features]))
if test "$enable_discouraged" = no; then if test "$enable_discouraged" = no; then
SCM_I_GSC_ENABLE_DISCOURAGED=0 SCM_I_GSC_ENABLE_DISCOURAGED=0
@ -152,7 +155,7 @@ else
fi fi
AC_ARG_ENABLE([deprecated], AC_ARG_ENABLE([deprecated],
AC_HELP_STRING([--disable-deprecated],[omit deprecated features])) AS_HELP_STRING([--disable-deprecated],[omit deprecated features]))
if test "$enable_deprecated" = no; then if test "$enable_deprecated" = no; then
SCM_I_GSC_ENABLE_DEPRECATED=0 SCM_I_GSC_ENABLE_DEPRECATED=0
@ -173,6 +176,51 @@ AC_ARG_ENABLE(elisp,
[ --disable-elisp omit Emacs Lisp support],, [ --disable-elisp omit Emacs Lisp support],,
enable_elisp=yes) enable_elisp=yes)
dnl Added the following configure option in January 2008 following
dnl investigation of problems with "64" system and library calls on
dnl Darwin (MacOS X). The libguile code (_scm.h) assumes that if a
dnl system has stat64, it will have all the other 64 APIs too; but on
dnl Darwin, stat64 is there but other APIs are missing.
dnl
dnl It also appears, from the Darwin docs, that most system call APIs
dnl there (i.e. the traditional ones _without_ "64" in their names) have
dnl been 64-bit-capable for a long time now, so it isn't necessary to
dnl use "64" versions anyway. For example, Darwin's off_t is 64-bit.
dnl
dnl A similar problem has been reported for HP-UX:
dnl http://www.nabble.com/Building-guile-1.8.2-on-hpux-td13106681.html
dnl
dnl Therefore, and also because a Guile without LARGEFILE64 support is
dnl better than no Guile at all, we provide this option to suppress
dnl trying to use "64" calls.
dnl
dnl It may be that for some 64-bit function on Darwin/HP-UX we do need
dnl to use a "64" call, and hence that by using --without-64-calls we're
dnl missing out on that. If so, someone can work on that in the future.
dnl For now, --without-64-calls allows Guile to build on OSs where it
dnl wasn't building before.
AC_MSG_CHECKING([whether to use system and library "64" calls])
AC_ARG_WITH([64-calls],
AS_HELP_STRING([--without-64-calls],
[don't attempt to use system and library calls with "64" in their names]),
[use_64_calls=$withval],
[use_64_calls=yes
case $host in
*-apple-darwin* )
use_64_calls=no
;;
powerpc-ibm-aix* )
use_64_calls=no
;;
esac])
AC_MSG_RESULT($use_64_calls)
case "$use_64_calls" in
y* )
AC_DEFINE(GUILE_USE_64_CALLS, 1,
[Define to 1 in order to try to use "64" versions of system and library calls.])
;;
esac
#-------------------------------------------------------------------- #--------------------------------------------------------------------
dnl Check for dynamic linking dnl Check for dynamic linking
@ -534,9 +582,38 @@ AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H]) AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME AC_HEADER_TIME
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
# Reason for checking:
#
# HP-UX 11.11 (at least) doesn't provide `struct dirent64', even
# with `_LARGEFILE64_SOURCE', so check whether it's available.
#
AC_CHECK_MEMBER([struct dirent64.d_name],
[SCM_I_GSC_HAVE_STRUCT_DIRENT64=1], [SCM_I_GSC_HAVE_STRUCT_DIRENT64=0],
[ #ifndef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE
#endif
/* Per Autoconf manual. */
#include <sys/types.h>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
#else
# define dirent direct
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif
#endif ])
AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
# Reasons for testing: # Reasons for testing:
# complex.h - new in C99 # complex.h - new in C99
@ -635,6 +712,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
# pipe - not in mingw # pipe - not in mingw
# _pipe - specific to mingw, taking 3 args # _pipe - specific to mingw, taking 3 args
# readdir_r - recent posix, not on old systems # readdir_r - recent posix, not on old systems
# readdir64_r - not available on HP-UX 11.11
# stat64 - SuS largefile stuff, not on old systems # stat64 - SuS largefile stuff, not on old systems
# sysconf - not on old systems # sysconf - not on old systems
# truncate - not in mingw # truncate - not in mingw
@ -643,7 +721,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin # strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
# nl_langinfo - X/Open, not available on Windows. # nl_langinfo - X/Open, not available on Windows.
# #
AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale nl_langinfo]) AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale nl_langinfo])
# Reasons for testing: # Reasons for testing:
# netdb.h - not in mingw # netdb.h - not in mingw
@ -675,6 +753,37 @@ AC_SEARCH_LIBS(crypt, crypt,
[AC_DEFINE(HAVE_CRYPT,1, [AC_DEFINE(HAVE_CRYPT,1,
[Define to 1 if you have the `crypt' function.])]) [Define to 1 if you have the `crypt' function.])])
# When compiling with GCC on some OSs (Solaris, AIX), _Complex_I doesn't
# work; in the reported cases so far, 1.0fi works well instead. According
# to the C99 spec, the complex.h header must provide a working definition
# of _Complex_I, so we always try _Complex_I first. The 1.0fi fallback
# is a workaround for the failure of some systems to conform to C99.
if test "$ac_cv_type_complex_double" = yes; then
AC_MSG_CHECKING([for i])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_COMPLEX_H
#include <complex.h>
#endif
complex double z;
]], [[
z = _Complex_I;
]])],
[AC_DEFINE(GUILE_I,_Complex_I,[The imaginary unit (positive square root of -1).])
AC_MSG_RESULT([_Complex_I])],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_COMPLEX_H
#include <complex.h>
#endif
complex double z;
]],[[
z = 1.0fi;
]])],
[AC_DEFINE(GUILE_I,1.0fi)
AC_MSG_RESULT([1.0fi])],
[ac_cv_type_complex_double=no
AC_MSG_RESULT([not available])])])
fi
# glibc 2.3.6 (circa 2006) and various prior versions had a bug where # glibc 2.3.6 (circa 2006) and various prior versions had a bug where
# csqrt(-i) returned a negative real part, when it should be positive # csqrt(-i) returned a negative real part, when it should be positive
# for the principal root. # for the principal root.
@ -683,7 +792,7 @@ if test "$ac_cv_type_complex_double" = yes; then
AC_CACHE_CHECK([whether csqrt is usable], AC_CACHE_CHECK([whether csqrt is usable],
guile_cv_use_csqrt, guile_cv_use_csqrt,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <complex.h> #include <complex.h>
/* "volatile" is meant to prevent gcc from calculating the sqrt as a /* "volatile" is meant to prevent gcc from calculating the sqrt as a
constant, we want to test libc. */ constant, we want to test libc. */
@ -696,7 +805,7 @@ main (void)
return 0; /* good */ return 0; /* good */
else else
return 1; /* bad */ return 1; /* bad */
}], }]])],
[guile_cv_use_csqrt=yes], [guile_cv_use_csqrt=yes],
[guile_cv_use_csqrt="no, glibc 2.3 bug"], [guile_cv_use_csqrt="no, glibc 2.3 bug"],
[guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])]) [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
@ -713,8 +822,9 @@ AC_CHECK_LIB([gmp], [__gmpz_init], ,
[AC_MSG_ERROR([GNU MP not found, see README])]) [AC_MSG_ERROR([GNU MP not found, see README])])
# mpz_import is a macro so we need to include <gmp.h> # mpz_import is a macro so we need to include <gmp.h>
AC_TRY_LINK([#include <gmp.h>], AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gmp.h>]],
[mpz_import (0, 0, 0, 0, 0, 0, 0);] , , [[mpz_import (0, 0, 0, 0, 0, 0, 0); ]])],
[],
[AC_MSG_ERROR([At least GNU MP 4.1 is required, see README])]) [AC_MSG_ERROR([At least GNU MP 4.1 is required, see README])])
dnl i18n tests dnl i18n tests
@ -792,11 +902,11 @@ AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
AC_MSG_CHECKING(for __libc_stack_end) AC_MSG_CHECKING(for __libc_stack_end)
AC_CACHE_VAL(guile_cv_have_libc_stack_end, AC_CACHE_VAL(guile_cv_have_libc_stack_end,
[AC_TRY_LINK([#include <stdio.h> [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
extern char *__libc_stack_end;], extern char *__libc_stack_end;]],
[printf("%p", (char*) __libc_stack_end);], [[printf("%p", (char*) __libc_stack_end);]])],
guile_cv_have_libc_stack_end=yes, [guile_cv_have_libc_stack_end=yes],
guile_cv_have_libc_stack_end=no)]) [guile_cv_have_libc_stack_end=no])])
AC_MSG_RESULT($guile_cv_have_libc_stack_end) AC_MSG_RESULT($guile_cv_have_libc_stack_end)
if test $guile_cv_have_libc_stack_end = yes; then if test $guile_cv_have_libc_stack_end = yes; then
@ -809,9 +919,10 @@ dnl macro. With cygwin it may be in a DLL.
AC_MSG_CHECKING(whether netdb.h declares h_errno) AC_MSG_CHECKING(whether netdb.h declares h_errno)
AC_CACHE_VAL(guile_cv_have_h_errno, AC_CACHE_VAL(guile_cv_have_h_errno,
[AC_TRY_COMPILE([#include <netdb.h>], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
[int a = h_errno;], [[int a = h_errno;]])],
guile_cv_have_h_errno=yes, guile_cv_have_h_errno=no)]) [guile_cv_have_h_errno=yes],
[guile_cv_have_h_errno=no])])
AC_MSG_RESULT($guile_cv_have_h_errno) AC_MSG_RESULT($guile_cv_have_h_errno)
if test $guile_cv_have_h_errno = yes; then if test $guile_cv_have_h_errno = yes; then
AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.]) AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.])
@ -819,15 +930,16 @@ fi
AC_MSG_CHECKING(whether uint32_t is defined) AC_MSG_CHECKING(whether uint32_t is defined)
AC_CACHE_VAL(guile_cv_have_uint32_t, AC_CACHE_VAL(guile_cv_have_uint32_t,
[AC_TRY_COMPILE([#include <sys/types.h> [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#if HAVE_STDINT_H #if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif #endif
#ifndef HAVE_NETDB_H #ifndef HAVE_NETDB_H
#include <netdb.h> #include <netdb.h>
#endif], #endif]],
[uint32_t a;], [[uint32_t a;]])],
guile_cv_have_uint32_t=yes, guile_cv_have_uint32_t=no)]) [guile_cv_have_uint32_t=yes],
[guile_cv_have_uint32_t=no])])
AC_MSG_RESULT($guile_cv_have_uint32_t) AC_MSG_RESULT($guile_cv_have_uint32_t)
if test $guile_cv_have_uint32_t = yes; then if test $guile_cv_have_uint32_t = yes; then
AC_DEFINE(HAVE_UINT32_T, 1, AC_DEFINE(HAVE_UINT32_T, 1,
@ -836,14 +948,15 @@ fi
AC_MSG_CHECKING(for working IPv6 support) AC_MSG_CHECKING(for working IPv6 support)
AC_CACHE_VAL(guile_cv_have_ipv6, AC_CACHE_VAL(guile_cv_have_ipv6,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/socket.h>], #include <sys/socket.h>]],
[struct sockaddr_in6 a; a.sin6_family = AF_INET6;], [[struct sockaddr_in6 a; a.sin6_family = AF_INET6;]])],
guile_cv_have_ipv6=yes, guile_cv_have_ipv6=no)]) [guile_cv_have_ipv6=yes],
[guile_cv_have_ipv6=no])])
AC_MSG_RESULT($guile_cv_have_ipv6) AC_MSG_RESULT($guile_cv_have_ipv6)
if test $guile_cv_have_ipv6 = yes; then if test $guile_cv_have_ipv6 = yes; then
AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.]) AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.])
@ -852,13 +965,14 @@ fi
# included in rfc2553 but not in older implementations, e.g., glibc 2.1.3. # included in rfc2553 but not in older implementations, e.g., glibc 2.1.3.
AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id) AC_MSG_CHECKING(whether sockaddr_in6 has sin6_scope_id)
AC_CACHE_VAL(guile_cv_have_sin6_scope_id, AC_CACHE_VAL(guile_cv_have_sin6_scope_id,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
#include <netinet/in.h>], #include <netinet/in.h>]],
[struct sockaddr_in6 sok; sok.sin6_scope_id = 0;], [[struct sockaddr_in6 sok; sok.sin6_scope_id = 0;]])],
guile_cv_have_sin6_scope_id=yes, guile_cv_have_sin6_scope_id=no)]) [guile_cv_have_sin6_scope_id=yes],
[guile_cv_have_sin6_scope_id=no])])
AC_MSG_RESULT($guile_cv_have_sin6_scope_id) AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
if test $guile_cv_have_sin6_scope_id = yes; then if test $guile_cv_have_sin6_scope_id = yes; then
AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1, AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1,
@ -875,7 +989,7 @@ AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],,,
AC_MSG_CHECKING(whether localtime caches TZ) AC_MSG_CHECKING(whether localtime caches TZ)
AC_CACHE_VAL(guile_cv_localtime_cache, AC_CACHE_VAL(guile_cv_localtime_cache,
[if test x$ac_cv_func_tzset = xyes; then [if test x$ac_cv_func_tzset = xyes; then
AC_TRY_RUN([#include <time.h> AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
#if STDC_HEADERS #if STDC_HEADERS
# include <stdlib.h> # include <stdlib.h>
#endif #endif
@ -906,7 +1020,9 @@ main()
if (localtime (&now)->tm_hour != hour_unset) if (localtime (&now)->tm_hour != hour_unset)
exit (1); exit (1);
exit (0); exit (0);
}], guile_cv_localtime_cache=no, guile_cv_localtime_cache=yes, }]])],
[guile_cv_localtime_cache=no],
[guile_cv_localtime_cache=yes],
[# If we have tzset, assume the worst when cross-compiling. [# If we have tzset, assume the worst when cross-compiling.
guile_cv_localtime_cache=yes]) guile_cv_localtime_cache=yes])
else else
@ -1024,12 +1140,39 @@ GUILE_STRUCT_UTIMBUF
# #
# Which way does the stack grow? # Which way does the stack grow?
# #
# Following code comes from Autoconf 2.61's internal _AC_LIBOBJ_ALLOCA
# macro (/usr/share/autoconf/autoconf/functions.m4). Gnulib has
# very similar code, so in future we could look at using that.
#
# An important detail is that the code involves find_stack_direction
# calling _itself_ - which means that find_stack_direction (or at
# least the second find_stack_direction() call) cannot be inlined.
# If the code could be inlined, that might cause the test to give
# an incorrect answer.
#-------------------------------------------------------------------- #--------------------------------------------------------------------
SCM_I_GSC_STACK_GROWS_UP=0 SCM_I_GSC_STACK_GROWS_UP=0
AC_TRY_RUN(aux (l) unsigned long l; AC_RUN_IFELSE([AC_LANG_SOURCE(
{ int x; exit (l >= ((unsigned long)&x)); } [AC_INCLUDES_DEFAULT
main () { int q; aux((unsigned long)&q); }, int
find_stack_direction ()
{
static char *addr = 0;
auto char dummy;
if (addr == 0)
{
addr = &dummy;
return find_stack_direction ();
}
else
return (&dummy > addr) ? 1 : -1;
}
int
main ()
{
return find_stack_direction () < 0;
}])],
[SCM_I_GSC_STACK_GROWS_UP=1], [SCM_I_GSC_STACK_GROWS_UP=1],
[], [],
[AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)]) [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])
@ -1054,12 +1197,12 @@ fi
AC_MSG_CHECKING(for struct linger) AC_MSG_CHECKING(for struct linger)
AC_CACHE_VAL(scm_cv_struct_linger, AC_CACHE_VAL(scm_cv_struct_linger,
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>], #include <sys/socket.h>]],
[struct linger lgr; lgr.l_linger = 100], [[struct linger lgr; lgr.l_linger = 100]])],
scm_cv_struct_linger="yes", [scm_cv_struct_linger="yes"],
scm_cv_struct_linger="no")) [scm_cv_struct_linger="no"]))
AC_MSG_RESULT($scm_cv_struct_linger) AC_MSG_RESULT($scm_cv_struct_linger)
if test $scm_cv_struct_linger = yes; then if test $scm_cv_struct_linger = yes; then
AC_DEFINE(HAVE_STRUCT_LINGER, 1, AC_DEFINE(HAVE_STRUCT_LINGER, 1,
@ -1072,14 +1215,13 @@ fi
# #
AC_MSG_CHECKING(for struct timespec) AC_MSG_CHECKING(for struct timespec)
AC_CACHE_VAL(scm_cv_struct_timespec, AC_CACHE_VAL(scm_cv_struct_timespec,
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <time.h> #include <time.h>
#if HAVE_PTHREAD_H #if HAVE_PTHREAD_H
#include <pthread.h> #include <pthread.h>
#endif], #endif]], [[struct timespec t; t.tv_nsec = 100]])],
[struct timespec t; t.tv_nsec = 100], [scm_cv_struct_timespec="yes"],
scm_cv_struct_timespec="yes", [scm_cv_struct_timespec="no"]))
scm_cv_struct_timespec="no"))
AC_MSG_RESULT($scm_cv_struct_timespec) AC_MSG_RESULT($scm_cv_struct_timespec)
if test $scm_cv_struct_timespec = yes; then if test $scm_cv_struct_timespec = yes; then
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
@ -1106,6 +1248,9 @@ AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER, 0)
case "$with_threads" in case "$with_threads" in
"yes" | "pthread" | "pthreads" | "pthread-threads" | "") "yes" | "pthread" | "pthreads" | "pthread-threads" | "")
build_pthread_support="yes"
ACX_PTHREAD(CC="$PTHREAD_CC" ACX_PTHREAD(CC="$PTHREAD_CC"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
SCM_I_GSC_USE_PTHREAD_THREADS=1 SCM_I_GSC_USE_PTHREAD_THREADS=1
@ -1185,6 +1330,10 @@ esac
AC_MSG_CHECKING(what kind of threads to support) AC_MSG_CHECKING(what kind of threads to support)
AC_MSG_RESULT($with_threads) AC_MSG_RESULT($with_threads)
AM_CONDITIONAL([BUILD_PTHREAD_SUPPORT],
[test "x$build_pthread_support" = "xyes"])
## Check whether pthread_attr_getstack works for the main thread ## Check whether pthread_attr_getstack works for the main thread
if test "$with_threads" = pthreads; then if test "$with_threads" = pthreads; then
@ -1192,8 +1341,7 @@ if test "$with_threads" = pthreads; then
AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread) AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
old_CFLAGS="$CFLAGS" old_CFLAGS="$CFLAGS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
AC_TRY_RUN( AC_RUN_IFELSE([AC_LANG_SOURCE([[
[
#if HAVE_PTHREAD_ATTR_GETSTACK #if HAVE_PTHREAD_ATTR_GETSTACK
#include <pthread.h> #include <pthread.h>
@ -1218,10 +1366,11 @@ int main ()
return 1; return 1;
} }
#endif #endif
], ]])],
[works=yes [works=yes
AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])], AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
[works=no]) [works=no],
[])
CFLAGS="$old_CFLAGS" CFLAGS="$old_CFLAGS"
AC_MSG_RESULT($works) AC_MSG_RESULT($works)
@ -1279,17 +1428,19 @@ case "$GCC" in
## less than exasperating. ## less than exasperating.
## -Wpointer-arith was here too, but something changed in gcc/glibc ## -Wpointer-arith was here too, but something changed in gcc/glibc
## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2). ## and it became equally exasperating (gcc 2.95 and/or glibc 2.1.2).
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes" GCC_CFLAGS="-Wall -Wmissing-prototypes"
# Do this here so we don't screw up any of the tests above that might # Do this here so we don't screw up any of the tests above that might
# not be "warning free" # not be "warning free"
if test "${GUILE_ERROR_ON_WARNING}" = yes if test "${GUILE_ERROR_ON_WARNING}" = yes
then then
CFLAGS="${CFLAGS} -Werror" GCC_CFLAGS="${GCC_CFLAGS} -Werror"
enable_compile_warnings=no enable_compile_warnings=no
fi fi
;; ;;
esac esac
AC_SUBST(GCC_CFLAGS)
## If we're creating a shared library (using libtool!), then we'll ## If we're creating a shared library (using libtool!), then we'll
## need to generate a list of .lo files corresponding to the .o files ## need to generate a list of .lo files corresponding to the .o files
## given in LIBOBJS. We'll call it LIBLOBJS. ## given in LIBOBJS. We'll call it LIBLOBJS.
@ -1348,7 +1499,7 @@ AC_SUBST(LIBGUILE_I18N_INTERFACE)
dnl Tell guile-config what flags guile users should compile and link with. dnl Tell guile-config what flags guile users should compile and link with.
GUILE_LIBS="$LDFLAGS $LIBS" GUILE_LIBS="$LDFLAGS $LIBS"
GUILE_CFLAGS="$PTHREAD_CFLAGS" GUILE_CFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
AC_SUBST(GUILE_LIBS) AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_CFLAGS) AC_SUBST(GUILE_CFLAGS)
@ -1363,6 +1514,12 @@ AC_SUBST(top_builddir_absolute)
top_srcdir_absolute=`(cd $srcdir && pwd)` top_srcdir_absolute=`(cd $srcdir && pwd)`
AC_SUBST(top_srcdir_absolute) AC_SUBST(top_srcdir_absolute)
dnl We need `sitedir' in `guile-1.8.pc'.
dnl Note: `sitedir' must be kept in sync with `GUILE_SITE_DIR' in `guile.m4'.
pkgdatadir="$datadir/guile"
sitedir="$pkgdatadir/site"
AC_SUBST([sitedir])
# Additional SCM_I_GSC definitions are above. # Additional SCM_I_GSC definitions are above.
AC_SUBST([SCM_I_GSC_GUILE_DEBUG]) AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST]) AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST])
@ -1409,6 +1566,7 @@ AC_CONFIG_FILES([
test-suite/standalone/Makefile test-suite/standalone/Makefile
]) ])
AC_CONFIG_FILES([guile-1.8.pc])
AC_CONFIG_FILES([check-guile], [chmod +x check-guile]) AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile]) AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools]) AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools])

1
doc/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
stamp-vti

View file

View file

@ -1,3 +1,13 @@
2008-04-26 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (EXAMPLE_SMOB_FILES): Remove `COPYING'.
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* COPYING: Removed.
* oldfmt.c: Update copyright statement to LGPL.
2002-09-14 Rob Browning <rlb@defaultvalue.org> 2002-09-14 Rob Browning <rlb@defaultvalue.org>
* .cvsignore: add stamp-vti.1 * .cvsignore: add stamp-vti.1

View file

@ -1,6 +1,6 @@
## Process this file with Automake to create Makefile.in ## Process this file with Automake to create Makefile.in
## ##
## Copyright (C) 1998, 2002, 2006 Free Software Foundation, Inc. ## Copyright (C) 1998, 2002, 2006, 2008 Free Software Foundation, Inc.
## ##
## This file is part of GUILE. ## This file is part of GUILE.
## ##
@ -27,7 +27,7 @@ SUBDIRS = ref tutorial goops r5rs
# man_MANS = guile.1 # man_MANS = guile.1
EXAMPLE_SMOB_FILES = \ EXAMPLE_SMOB_FILES = \
ChangeLog Makefile README COPYING image-type.c image-type.h myguile.c ChangeLog Makefile README image-type.c image-type.h myguile.c
OLDFMT = oldfmt.c OLDFMT = oldfmt.c
@ -43,9 +43,8 @@ EXTRA_DIST = groupings.alist # guile-api.alist
# pending the papers from Robert Merkel # pending the papers from Robert Merkel
# EXTRA_DIST = guile.1 # EXTRA_DIST = guile.1
if MAINTAINER_MODE
include $(top_srcdir)/am/maintainer-dirs include $(top_srcdir)/am/maintainer-dirs
guile-api.alist: guile-api.alist-FORCE guile-api.alist: guile-api.alist-FORCE
( cd $(top_builddir) ; $(mscripts)/update-guile-api.alist ) ( cd $(top_builddir) ; $(mscripts)/update-guile-api.alist )
guile-api.alist-FORCE: guile-api.alist-FORCE:
endif

View file

@ -1,3 +1,7 @@
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* COPYING: Removed.
2004-09-24 Marius Vollmer <mvo@zagadka.de> 2004-09-24 Marius Vollmer <mvo@zagadka.de>
* image-type.c: Updated from manual. * image-type.c: Updated from manual.

View file

@ -1,3 +1,8 @@
2008-02-06 Neil Jerram <neil@ossau.uklinux.net>
* goops-tutorial.texi (Next-method): Minor improvements to the
text.
2006-09-28 Neil Jerram <neil@ossau.uklinux.net> 2006-09-28 Neil Jerram <neil@ossau.uklinux.net>
* goops.texi (Slot Options): Added example from Ludovic Courtès * goops.texi (Slot Options): Added example from Ludovic Courtès

View file

@ -690,11 +690,12 @@ In this case,
@node Next-method, Example, Generic functions and methods, Generic functions @node Next-method, Example, Generic functions and methods, Generic functions
@subsection Next-method @subsection Next-method
When a generic function is called, the list of applicable methods is When you call a generic function, with a particular set of arguments,
built. As mentioned before, the most specific method of this list is GOOPS builds a list of all the methods that are applicable to those
applied (see@ @ref{Generic functions and methods}). This method may call arguments and orders them by how closely the method definitions match
the next method in the list of applicable methods. This is done by using the actual argument types. It then calls the method at the top of this
the special form @code{next-method}. Consider the following definitions list. If the selected method's code wants to call on to the next method
in this list, it can do so by using @code{next-method}.
@lisp @lisp
(define-method (Test (a <integer>)) (cons 'integer (next-method))) (define-method (Test (a <integer>)) (cons 'integer (next-method)))
@ -702,7 +703,7 @@ the special form @code{next-method}. Consider the following definitions
(define-method (Test a) (list 'top)) (define-method (Test a) (list 'top))
@end lisp @end lisp
With those definitions, With these definitions,
@lisp @lisp
(Test 1) @result{} (integer number top) (Test 1) @result{} (integer number top)
@ -710,6 +711,32 @@ With those definitions,
(Test #t) @result{} (top) (Test #t) @result{} (top)
@end lisp @end lisp
@code{next-method} is always called as just @code{(next-method)}. The
arguments for the next method call are always implicit, and always the
same as for the original method call.
If you want to call on to a method with the same name but with a
different set of arguments (as you might with overloaded methods in C++,
for example), you do not use @code{next-method}, but instead simply
write the new call as usual:
@lisp
(define-method (Test (a <number>) min max)
(if (and (>= a min) (<= a max))
(display "Number is in range\n"))
(Test a))
(Test 2 1 10)
@print{}
Number is in range
@result{}
(integer number top)
@end lisp
(You should be careful in this case that the @code{Test} calls do not
lead to an infinite recursion, but this consideration is just the same
as in Scheme code in general.)
@node Example, , Next-method, Generic functions @node Example, , Next-method, Generic functions
@subsection Example @subsection Example

View file

@ -1,43 +1,18 @@
/* Copyright (C) 2000,2001, 2006 Free Software Foundation, Inc. /* Copyright (C) 2000,2001, 2006, 2008 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU Lesser General Public
* the Free Software Foundation; either version 2, or (at your option) * License as published by the Free Software Foundation; either
* any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU Lesser General Public
* along with this software; see the file COPYING. If not, write to * License along with this library; if not, write to the Free Software
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Boston, MA 02110-1301 USA
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
*
* The exception is that, if you link the GUILE library with other files
* to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the GUILE library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the
* Free Software Foundation under the name GUILE. If you copy
* code from other Free Software Foundation releases into a copy of
* GUILE, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*/ */

View file

@ -22,6 +22,7 @@ Makefile
Makefile.in Makefile.in
autoconf-macros.texi autoconf-macros.texi
mdate-sh mdate-sh
lib-version.texi
stamp-vti stamp-vti
stamp-vti.1 stamp-vti.1
texinfo.tex texinfo.tex

2
doc/ref/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
autoconf-macros.texi
lib-version.texi

View file

@ -1,3 +1,153 @@
2008-07-17 Neil Jerram <neil@ossau.uklinux.net>
* scheme-using.texi (Evaluating Scheme Code): Document use of
`C-u' prefix with evaluation commands.
2008-07-05 Ludovic Courtès <ludo@gnu.org>
* api-data.texi (Symbol Primitives): Add `scm_c_symbol_length ()'.
2008-06-30 Julian Graham <joolean@gmail.com>
* srfi-modules.texi (SRFI-18): New section.
(SRFI-19 Time): Mention SRFI-18's `current-time'.
2008-06-28 Ludovic Courtès <ludo@gnu.org>
* api-modules.texi (Using Guile Modules): Substitute "syntax
transformer" to "system transformer". Reported by Sebastian
Tennant <sebyte@smolny.plus.com>.
2008-06-01 Ludovic Courtès <ludo@gnu.org>
* srfi-modules.texi (SRFI-88): Fix URL.
2008-05-14 Julian Graham <joolean@gmail.com>
* api-scheduling.texi (Mutexes and Condition Variables): Add
documentation for new functions "scm_mutex_owner",
"scm_mutex_level", and "scm_mutex_locked_p". Update
documentation for function "scm_lock_mutex_timed" to reflect
addition of optional ownership argument.
2008-05-07 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (autoconf-macros.texi): Avoid use of GNU Make
specific `$<' variable. This broke with BSD Make as found on
FreeBSD 6.2.
2008-05-05 Neil Jerram <neil@ossau.uklinux.net>
* scheme-using.texi (Using Guile in Emacs): Add concept index
entries `GDS' and `Emacs'.
* api-debug.texi (Debugging): Add concept index entry `Debugging'.
2008-05-04 Ludovic Courtès <ludo@gnu.org>
* guile.texi (Guile Modules): Include `autoconf.texi'.
* autoconf.texi (Autoconf Support): Mention `pkg-config'.
(Autoconf Macros): Document `pkg-config' support.
2008-04-26 Ludovic Courtès <ludo@gnu.org>
* srfi-modules.texi (SRFI-88): New section.
* api-data.texi (Keyword Read Syntax): Add reference to
`SRFI-88'.
2008-04-17 Neil Jerram <neil@ossau.uklinux.net>
* posix.texi (File System): New doc for file-exists?.
2008-04-15 Ludovic Courtès <ludo@gnu.org>
* api-data.texi (Keywords): Mention postfix syntax.
(Keyword Read Syntax): Document `postfix' read option.
* api-options.texi (Reader options): Update examples.
(Examples of option use): Likewise.
2008-03-28 Neil Jerram <neil@ossau.uklinux.net>
* libguile-concepts.texi (Multi-Threading): Fix typo.
2008-03-24 Neil Jerram <neil@ossau.uklinux.net>
Applying patch from Julian Graham, containing minor fixes to his
thread enhancements:
* api-scheduling.texi (Mutexes and Condition Variables): Change
`flag' to `flags' in docstring.
2008-03-19 Neil Jerram <neil@ossau.uklinux.net>
* api-debug.texi (Low Level Trap Calls): Removed (material
duplicated elsewhere); doc for with-traps and debug-object? moved
to section on evaluator trap options.
(High Level Traps): Renamed just `Traps'. Add references to
evaluator trap options and debug options. Make language
appropriate for core Guile (as opposed to previously separate
package).
(Location Traps): Corrected to reflect that location traps now
specify a specific position, not a range of positions.
(Debugging Examples): New (content moved here from
scheme-debugging.texi, and updated to use traps instead of
breakpoints).
* api-modules.texi (Included Guile Modules): Change `Debugging
Features' reference to `Tracing'.
* api-options.texi (Evaluator trap options): Doc for with-traps
and debug-object? is now here.
* guile.texi, scheme-debugging.texi: Move the `Tracing' content of
scheme-debugging.texi to the Modules section.
* scheme-using.texi (Using Guile in Emacs, GDS Getting Started):
Minor edits.
* scheme-debugging.texi (Debugging Features, Intro to
Breakpoints): Removed.
(Examples): Moved to api-debug.texi.
(Tracing, Old Tracing): Promoted one level.
(New Tracing, Tracing Compared): Removed.
2008-03-08 Julian Graham <joolean@gmail.com>
* api-scheduling.texi (Threads): Add documentation for new
functions "scm_thread_p" and new "scm_join_thread_timed".
(Mutexes and Condition Variables): Add documentation for new
functions "scm_make_mutex_with_flags", "scm_mutex_p",
"scm_lock_mutex_timed", "scm_unlock_mutex_timed", and
"scm_condition_variable_p".
2008-02-11 Neil Jerram <neil@ossau.uklinux.net>
* api-data.texi (Random): New text about the default random state,
following suggestions by Stephen Uitti.
2008-02-01 Neil Jerram <neil@ossau.uklinux.net>
* api-scheduling.texi (Threads): Add "C Function scm_join_thread"
to doc for join-thread. Thanks to Antoine Mathys for reporting
that scm_join_thread was missing.
2007-12-09 Stephen Compall <s11@member.fsf.org>
* srfi-modules.texi (SRFI-69): Avoid use of the first person.
2007-12-03 Stephen Compall <s11@member.fsf.org>
* srfi-modules.texi: Describe SRFI-69 in a new subsection.
2007-10-29 Julian Graham <joolean@gmail.com>
* api-scheduling.texi (Threads): Document `cancel-thread',
`set-thread-cleanup!' and `thread-cleanup'.
2007-10-24 Neil Jerram <neil@ossau.uklinux.net>
* .cvsignore: Add lib-version.texi.
2007-10-02 Ludovic Courtès <ludo@gnu.org> 2007-10-02 Ludovic Courtès <ludo@gnu.org>
* slib.texi (SLIB installation): Don't recommend using the site * slib.texi (SLIB installation): Don't recommend using the site

View file

@ -1,6 +1,6 @@
## Process this file with Automake to create Makefile.in ## Process this file with Automake to create Makefile.in
## ##
## Copyright (C) 1998, 2004, 2006 Free Software Foundation, Inc. ## Copyright (C) 1998, 2004, 2006, 2008 Free Software Foundation, Inc.
## ##
## This file is part of GUILE. ## This file is part of GUILE.
## ##
@ -86,7 +86,8 @@ include $(top_srcdir)/am/pre-inst-guile
autoconf.texi: autoconf-macros.texi autoconf.texi: autoconf-macros.texi
autoconf-macros.texi: $(top_srcdir)/guile-config/guile.m4 autoconf-macros.texi: $(top_srcdir)/guile-config/guile.m4
$(preinstguiletool)/snarf-guile-m4-docs $< > $(srcdir)/$@ $(preinstguiletool)/snarf-guile-m4-docs $(top_srcdir)/guile-config/guile.m4 \
> $(srcdir)/$@
lib-version.texi: $(top_srcdir)/GUILE-VERSION lib-version.texi: $(top_srcdir)/GUILE-VERSION
cat "$^" | grep '^LIBGUILE_.*_MAJOR' | \ cat "$^" | grep '^LIBGUILE_.*_MAJOR' | \

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -1733,6 +1733,46 @@ The global random state used by the above functions when the
@var{state} parameter is not given. @var{state} parameter is not given.
@end defvar @end defvar
Note that the initial value of @code{*random-state*} is the same every
time Guile starts up. Therefore, if you don't pass a @var{state}
parameter to the above procedures, and you don't set
@code{*random-state*} to @code{(seed->random-state your-seed)}, where
@code{your-seed} is something that @emph{isn't} the same every time,
you'll get the same sequence of ``random'' numbers on every run.
For example, unless the relevant source code has changed, @code{(map
random (cdr (iota 30)))}, if the first use of random numbers since
Guile started up, will always give:
@lisp
(map random (cdr (iota 19)))
@result{}
(0 1 1 2 2 2 1 2 6 7 10 0 5 3 12 5 5 12)
@end lisp
To use the time of day as the random seed, you can use code like this:
@lisp
(let ((time (gettimeofday)))
(set! *random-state*
(seed->random-state (+ (car time)
(cdr time)))))
@end lisp
@noindent
And then (depending on the time of day, of course):
@lisp
(map random (cdr (iota 19)))
@result{}
(0 0 1 0 2 4 5 4 5 5 9 3 10 1 8 3 14 17)
@end lisp
For security applications, such as password generation, you should use
more bits of seed. Otherwise an open source password generator could
be attacked by guessing the seed@dots{} but that's a subject for
another manual.
@node Characters @node Characters
@subsection Characters @subsection Characters
@ -4607,6 +4647,11 @@ immediately after creating the Scheme string. In certain cases, Guile
can then use @var{str} directly as its internal representation. can then use @var{str} directly as its internal representation.
@end deftypefn @end deftypefn
The size of a symbol can also be obtained from C:
@deftypefn {C Function} size_t scm_c_symbol_length (SCM sym)
Return the number of characters in @var{sym}.
@end deftypefn
Finally, some applications, especially those that generate new Scheme Finally, some applications, especially those that generate new Scheme
code dynamically, need to generate symbols for use in the generated code dynamically, need to generate symbols for use in the generated
@ -4861,7 +4906,7 @@ makes them easy to type.
Guile's keyword support conforms to R5RS, and adds a (switchable) read Guile's keyword support conforms to R5RS, and adds a (switchable) read
syntax extension to permit keywords to begin with @code{:} as well as syntax extension to permit keywords to begin with @code{:} as well as
@code{#:}. @code{#:}, or to end with @code{:}.
@menu @menu
* Why Use Keywords?:: Motivation for keyword usage. * Why Use Keywords?:: Motivation for keyword usage.
@ -5006,9 +5051,16 @@ If the @code{keyword} read option is set to @code{'prefix}, Guile also
recognizes the alternative read syntax @code{:NAME}. Otherwise, tokens recognizes the alternative read syntax @code{:NAME}. Otherwise, tokens
of the form @code{:NAME} are read as symbols, as required by R5RS. of the form @code{:NAME} are read as symbols, as required by R5RS.
@cindex SRFI-88 keyword syntax
If the @code{keyword} read option is set to @code{'postfix}, Guile
recognizes the SRFI-88 read syntax @code{NAME:} (@pxref{SRFI-88}).
Otherwise, tokens of this form are read as symbols.
To enable and disable the alternative non-R5RS keyword syntax, you use To enable and disable the alternative non-R5RS keyword syntax, you use
the @code{read-set!} procedure documented in @ref{User level options the @code{read-set!} procedure documented in @ref{User level options
interfaces} and @ref{Reader options}. interfaces} and @ref{Reader options}. Note that the @code{prefix} and
@code{postfix} syntax are mutually exclusive.
@smalllisp @smalllisp
(read-set! keywords 'prefix) (read-set! keywords 'prefix)
@ -5021,6 +5073,16 @@ interfaces} and @ref{Reader options}.
@result{} @result{}
#:type #:type
(read-set! keywords 'postfix)
type:
@result{}
#:type
:type
@result{}
:type
(read-set! keywords #f) (read-set! keywords #f)
#:type #:type

View file

@ -8,6 +8,7 @@
@node Debugging @node Debugging
@section Debugging Infrastructure @section Debugging Infrastructure
@cindex Debugging
In order to understand Guile's debugging facilities, you first need to In order to understand Guile's debugging facilities, you first need to
understand a little about how the evaluator works and what the Scheme understand a little about how the evaluator works and what the Scheme
stack is. With that in place we explain the low level trap calls that stack is. With that in place we explain the low level trap calls that
@ -17,9 +18,9 @@ infrastructure that builds on top of those calls.
@menu @menu
* Evaluation Model:: Evaluation and the Scheme stack. * Evaluation Model:: Evaluation and the Scheme stack.
* Debug on Error:: Debugging when an error occurs. * Debug on Error:: Debugging when an error occurs.
* Low Level Trap Calls:: * Traps::
* High Level Traps::
* Breakpoints:: * Breakpoints::
* Debugging Examples::
@end menu @end menu
@node Evaluation Model @node Evaluation Model
@ -610,65 +611,8 @@ Invoke the Guile debugger to explore the context of the last error.
@end deffn @end deffn
@node Low Level Trap Calls @node Traps
@subsection Low Level Trap Calls @subsection Traps
@cindex Low level trap calls
@cindex Evaluator trap calls
Guile's evaluator can be configured to call the following four user-specified
procedures at various points in its operation.
@table @dfn
@item apply-frame-handler
@item enter-frame-handler
@item exit-frame-handler
@item memoize-symbol-handler
@end table
These procedures, and the circumstances under which the evaluator
calls them, are configured by the ``evaluator trap options'' interface
(@pxref{Evaluator trap options}), and by the @code{trace} and
@code{breakpoints} fields of the ``debug options'' interface
(@pxref{Debugger options}).
It is not necessary to understand the fine details of these low level
calls, and of the options which configure them, in order to use the
class-based trap interface effectively. @code{guile-debugging} takes
care of setting these options as required for whatever set of
installed trap objects the user specifies.@footnote{And consequently,
when using the class-based trap interface, users/applications should
@emph{not} modify these options themselves, to avoid interfering with
@code{guile-debugging}'s option settings.} It is useful, though, to
have a overall idea of how the evaluator works and when these low
level calls can happen, as follows.
@cindex Frame entry
@cindex Frame exit
On the basis of this description, we can now specify the points where
low level trap calls may occur (subject to configuration). Namely,
whenever a new frame is added to the stack, because the evaluator is
about to begin a new evaluation or to perform a new application, and
whenever a frame is being removed from the stack because the
computation that it refers to has completed and is returning its
value@footnote{If this raises the question of how expressions with
no return value are handled, the answer is that all computations in
Guile return a value. Those that appear to have no return value do so
by using the special @code{*unspecified*} value, which the Guile REPL
avoids displaying to the user.} to its caller.
@deffn {Scheme Procedure} with-traps thunk
@deffnx {C Function} scm_with_traps (thunk)
Call @var{thunk} with traps enabled.
@end deffn
@deffn {Scheme Procedure} debug-object? obj
@deffnx {C Function} scm_debug_object_p (obj)
Return @code{#t} if @var{obj} is a debug object.
@end deffn
@node High Level Traps
@subsection High Level Traps
@cindex Traps @cindex Traps
@cindex Evaluator trap calls @cindex Evaluator trap calls
@ -678,29 +622,33 @@ Return @code{#t} if @var{obj} is a debug object.
@cindex Code coverage @cindex Code coverage
@cindex Profiling @cindex Profiling
The low level C code of Guile's evaluator can be configured to call The low level C code of Guile's evaluator can be configured to call
out at key points to arbitrary user-specified code. In principle this out at key points to arbitrary user-specified procedures. These
allows Scheme code to implement any model it chooses for examining the procedures, and the circumstances under which the evaluator calls
evaluation stack as program execution proceeds, and for suspending them, are configured by the ``evaluator trap options'' interface
execution to be resumed later. Possible applications of this feature (@pxref{Evaluator trap options}), and by the @code{trace} and
include breakpoints, runtime tracing, code coverage, and profiling. @code{breakpoints} fields of the ``debug options'' interface
(@pxref{Debugger options}). In principle this allows Scheme code to
implement any model it chooses for examining the evaluation stack as
program execution proceeds, and for suspending execution to be resumed
later. Possible applications of this feature include breakpoints,
runtime tracing, code coverage, and profiling.
@cindex Trap classes @cindex Trap classes
@cindex Trap objects @cindex Trap objects
Based on these low level trap calls, the enhancements described here Based on these low level trap calls, Guile provides a higher level,
provide a much higher level, object-oriented interface for the object-oriented interface for the manipulation of traps. Different
manipulation of traps. Different kinds of trap are represented as kinds of trap are represented as GOOPS classes; for example, the
GOOPS classes; for example, the @code{<procedure-trap>} class @code{<procedure-trap>} class describes traps that are triggered by
describes traps that are triggered by invocation of a specified invocation of a specified procedure. A particular instance of a trap
procedure. A particular instance of a trap class --- or @dfn{trap class --- or @dfn{trap object} --- describes the condition under which
object} --- describes the condition under which a single trap will be a single trap will be triggered, and what will happen then; for
triggered, and what will happen then; for example, an instance of example, an instance of @code{<procedure-trap>} whose @code{procedure}
@code{<procedure-trap>} whose @code{procedure} and @code{behaviour} and @code{behaviour} slots contain @code{my-factorial} and
slots contain @code{my-factorial} and @code{debug-trap} would be a @code{debug-trap} would be a trap that enters the command line
trap that enters the command line debugger when the debugger when the @code{my-factorial} procedure is invoked.
@code{my-factorial} procedure is invoked.
The following subsubsections describe all this in greater detail, for both The following subsections describe all this in detail, for both the
the user wanting to use traps, and the developer interested in user wanting to use traps, and the developer interested in
understanding how the interface hangs together. understanding how the interface hangs together.
@ -813,8 +761,8 @@ shorthands for setting common kinds of traps. @xref{Trap Shorthands},
for some examples. for some examples.
The ability to install, uninstall and reinstall a trap without losing The ability to install, uninstall and reinstall a trap without losing
its definition is @code{guile-debugging}'s equivalent of the its definition is Guile's equivalent of the disable/enable commands
disable/enable commands provided by debuggers like GDB. provided by debuggers like GDB.
@deffn {Generic Function} install-trap trap @deffn {Generic Function} install-trap trap
Install the trap object @var{trap}, so that its behaviour will be Install the trap object @var{trap}, so that its behaviour will be
@ -832,9 +780,9 @@ met.
@subsubsection Specifying Trap Behaviour @subsubsection Specifying Trap Behaviour
@cindex Trap behaviour @cindex Trap behaviour
@code{guile-debugging} provides several ``out-of-the-box'' behaviours Guile provides several ``out-of-the-box'' behaviours for common needs.
for common needs. All of the following can be used directly as the All of the following can be used directly as the value of the
value of the @code{#:behaviour} option when creating a trap object. @code{#:behaviour} option when creating a trap object.
@deffn {Procedure} debug-trap trap-context @deffn {Procedure} debug-trap trap-context
Enter Guile's command line debugger to explore the stack at Enter Guile's command line debugger to explore the stack at
@ -1179,9 +1127,9 @@ guile> (rev '(a b c))
@node Tracing and (ice-9 debug) @node Tracing and (ice-9 debug)
@subsubsection Tracing and (ice-9 debug) @subsubsection Tracing and (ice-9 debug)
The @code{(ice-9 debug)} module of the core Guile distribution The @code{(ice-9 debug)} module provides a tracing facility
provides a tracing facility that is roughly similar to that described (@pxref{Tracing}) that is roughly similar to that described here, but
here, but there are important differences. there are important differences.
@itemize @bullet @itemize @bullet
@item @item
@ -1202,35 +1150,30 @@ in stack depth, by using indentation like this:
@end lisp @end lisp
However its output can @emph{only} show the information seen here, However its output can @emph{only} show the information seen here,
which corresponds to @code{guile-debugging}'s @code{trace/info} which corresponds to @code{(ice-9 debugging trace)}'s
procedure; it cannot be configured to show other pieces of information @code{trace/info} procedure; it cannot be configured to show other
about the trap context in the way that @code{guile-debugging}'s trace pieces of information about the trap context in the way that the
feature can. @code{(ice-9 debugging trace)} implementation can.
@item @item
The @code{(ice-9 debug)} trace only allows the tracing of procedure The @code{(ice-9 debug)} trace only allows the tracing of procedure
applications and their return values, whereas @code{guile-debugging}'s applications and their return values, whereas the @code{(ice-9 debugging
trace allows any kind of trap to be traced. trace)} implementation allows any kind of trap to be traced.
It's interesting to note that @code{(ice-9 debug)}'s restriction here, It's interesting to note that @code{(ice-9 debug)}'s restriction here,
which might initially appear to be just a straightforward consequence which might initially appear to be just a straightforward consequence
of its implementation, is also somewhat dictated by its pictorial of its implementation, is also somewhat dictated by its pictorial
display. The use of indentation in the output relies on hooking into display. The use of indentation in the output relies on hooking into
the low level trap calls in such a way that the trapped application the low level trap calls in such a way that the trapped application
entries and exits exactly balance each other. entries and exits exactly balance each other. The @code{ice-9
@code{guile-debugging}'s more general traps interface allows traps to debugging trace} implementation allows traps to be installed such that
be installed such that entry and exit traps don't necessarily balance, entry and exit traps don't necessarily balance, which means that, in
which means that, in general, indentation diagrams like the one above general, indentation diagrams like the one above don't work.
don't work.
@end itemize @end itemize
It isn't currently possible to use both @code{(ice-9 debug)} trace and It isn't currently possible to use both @code{(ice-9 debug)} trace and
@code{guile-debugging} in the same Guile session, because their settings @code{(ice-9 debugging trace)} in the same Guile session, because
of the low level trap options conflict with each other. (It should be their settings of the low level trap options conflict with each other.
possible to fix this, by modifying @code{(ice-9 debug)} to use
@code{guile-debugging}'s trap installation interface, but only if and
when @code{guile-debugging} is integrated into the core Guile
distribution.)
@node Traps Installing More Traps @node Traps Installing More Traps
@ -1456,9 +1399,9 @@ user would intuitively think of as single-stepping through their code,
either through code in general (roughly corresponding to GDB's either through code in general (roughly corresponding to GDB's
@code{step} command, for example), or through code from a particular @code{step} command, for example), or through code from a particular
source file (roughly corresponding to GDB's @code{next}). Therefore source file (roughly corresponding to GDB's @code{next}). Therefore
if you are using @code{guile-debugging} to single-step through code if you are using a step trap to single-step through code and finding
and finding its behaviour counter-intuitive, please let me know so its behaviour counter-intuitive, please report that so we can improve
that I can improve it. it.
The implementation and options of the @code{<step-trap>} class are The implementation and options of the @code{<step-trap>} class are
complicated by the fact that it is unreliable to determine whether a complicated by the fact that it is unreliable to determine whether a
@ -1620,16 +1563,16 @@ following subsubsection.
@subsubsection Location Traps @subsubsection Location Traps
The @code{<location-trap>} class implements traps that are triggered The @code{<location-trap>} class implements traps that are triggered
by evaluation of code at a specific source location or within a by evaluation of code at a specific source location. When compared
specified range of source locations. When compared with source traps, with source traps, they are easier to set, and do not become
they are easier to set, and do not become irrelevant when the relevant irrelevant when the relevant code is reloaded; but unfortunately they
code is reloaded; but unfortunately they are considerably less are a lot less efficient, as they require running some ``are we in the
efficient, as they require running some ``are we in the right place right place for a trap'' code on every low level frame entry trap
for a trap'' code on every low level frame entry trap call. call.
@deffn {Class} <location-trap> @deffn {Class} <location-trap>
Class for traps triggered by evaluation of code at a specific source Class for traps triggered by evaluation of code at a specific source
location or in a specified range of source locations. location.
@end deffn @end deffn
@deffn {Trap Option} #:file-regexp regexp @deffn {Trap Option} #:file-regexp regexp
@ -1637,31 +1580,27 @@ A regular expression specifying the filenames that will match this
trap. This option must be specified when creating a location trap. trap. This option must be specified when creating a location trap.
@end deffn @end deffn
@deffn {Trap Option} #:line line-spec @deffn {Trap Option} #:line line
If specified, @var{line-spec} describes either a single line, in which The line number (0-based) of the source location at which the trap
case it is a single integer, or a range of lines, in which case it is should be triggered. This option must be specified when creating a
a pair of the form @code{(@var{min-line} . @var{max-line})}. All line location trap.
numbers are 0-based, and the range form is inclusive-inclusive. If
@code{#f} or not specified, the trap is not restricted by line number.
(Default value @code{#f}.)
@end deffn @end deffn
@deffn {Trap Option} #:column column-spec @deffn {Trap Option} #:column column
If specified, @var{column-spec} describes either a single column, in The column number (0-based) of the source location at which the trap
which case it is a single integer, or a range of columns, in which should be triggered. This option must be specified when creating a
case it is a pair of the form @code{(@var{min-column} location trap.
. @var{max-column})}. All column numbers are 0-based, and the range
form is inclusive-inclusive. If @code{#f} or not specified, the trap
is not restricted by column number. (Default value @code{#f}.)
@end deffn @end deffn
@noindent @noindent
Example: Here is an example, which matches the @code{(facti (- n 1) (* a n))}
expression in @file{ice-9/debugging/example-fns.scm}:
@lisp @lisp
(install-trap (make <location-trap> (install-trap (make <location-trap>
#:file-regexp "example-fns.scm" #:file-regexp "example-fns.scm"
#:line '(11 . 13) #:line 11
#:column 6
#:behaviour gds-debug-trap)) #:behaviour gds-debug-trap))
@end lisp @end lisp
@ -1672,8 +1611,7 @@ Example:
If the code described in the preceding subsubsections for creating and If the code described in the preceding subsubsections for creating and
manipulating traps seems a little long-winded, it is of course manipulating traps seems a little long-winded, it is of course
possible to define more convenient shorthand forms for typical usage possible to define more convenient shorthand forms for typical usage
patterns. For example, my own @file{.guile} file contains the patterns. Here are some examples.
following definitions for setting breakpoints and for tracing.
@lisp @lisp
(define (break! proc) (define (break! proc)
@ -1694,11 +1632,11 @@ following definitions for setting breakpoints and for tracing.
trace-until-exit)))) trace-until-exit))))
@end lisp @end lisp
Definitions like these are not provided out-of-the-box by Definitions like these are not provided out-of-the-box by Guile,
@code{guile-debugging}, because different users will have different because different users will have different ideas about what their
ideas about what their default debugger should be, or, for example, default debugger should be, or, for example, which of the common trap
which of the common trap options (@pxref{Common Trap Options}) it options (@pxref{Common Trap Options}) it might be useful to expose
might be useful to expose through such shorthand procedures. through such shorthand procedures.
@node Trap Utilities @node Trap Utilities
@ -1760,12 +1698,11 @@ While they are an important piece of infrastructure, and directly
usable in some scenarios, traps are still too low level to meet some usable in some scenarios, traps are still too low level to meet some
of the requirements of interactive development. of the requirements of interactive development.
For example, in my experience a common scenario is that a newly A common scenario is that a newly written procedure is not working
written procedure is not working properly, and so you'd like to be properly, and so you'd like to be able to step or trace through its
able to step or trace through its code to find out why. Ideally this code to find out why. Ideally this should be possible from the IDE
should be possible from the IDE and without having to modify the and without having to modify the source code. There are two problems
source code. There are two problems with using traps directly in this with using traps directly in this scenario.
scenario.
@enumerate @enumerate
@item @item
@ -1885,6 +1822,216 @@ be managed through GDS. For the details of GDS's breakpoints
interface, see @ref{Setting and Managing Breakpoints}. interface, see @ref{Setting and Managing Breakpoints}.
@node Debugging Examples
@subsection Debugging Examples
Here we present some examples of what you can do with the debugging
facilities just described.
@menu
* Single Stepping through a Procedure's Code::
* Profiling or Tracing a Procedure's Code::
@end menu
@node Single Stepping through a Procedure's Code
@subsubsection Single Stepping through a Procedure's Code
A good way to explore in detail what a Scheme procedure does is to set
a trap on it and then single step through what it does. To do this,
make and install a @code{<procedure-trap>} with the @code{debug-trap}
behaviour from @code{(ice-9 debugging ice-9-debugger-extensions)}.
The following sample session illustrates this. It assumes that the
file @file{matrix.scm} defines a procedure @code{mkmatrix}, which is
the one we want to explore, and another procedure @code{do-main} which
calls @code{mkmatrix}.
@lisp
$ /usr/bin/guile -q
guile> (use-modules (ice-9 debugger)
(ice-9 debugging ice-9-debugger-extensions)
(ice-9 debugging traps))
guile> (load "matrix.scm")
guile> (install-trap (make <procedure-trap>
#:procedure mkmatrix
#:behaviour debug-trap))
guile> (do-main 4)
This is the Guile debugger -- for help, type `help'.
There are 3 frames on the stack.
Frame 2 at matrix.scm:8:3
[mkmatrix]
debug> next
Frame 3 at matrix.scm:4:3
(let ((x 1)) (quote this-is-a-matric))
debug> info frame
Stack frame: 3
This frame is an evaluation.
The expression being evaluated is:
matrix.scm:4:3:
(let ((x 1)) (quote this-is-a-matric))
debug> next
Frame 3 at matrix.scm:5:21
(quote this-is-a-matric)
debug> bt
In unknown file:
?: 0* [primitive-eval (do-main 4)]
In standard input:
4: 1* [do-main 4]
In matrix.scm:
8: 2 [mkmatrix]
...
5: 3 (quote this-is-a-matric)
debug> quit
this-is-a-matric
guile>
@end lisp
Or you can use Guile's Emacs interface (GDS), by using the module
@code{(ice-9 gds-client)} instead of @code{(ice-9 debugger)} and
@code{(ice-9 debugging ice-9-debugger-extensions)}, and changing
@code{debug-trap} to @code{gds-debug-trap}. Then the stack and
corresponding source locations are displayed in Emacs instead of on
the Guile command line.
@node Profiling or Tracing a Procedure's Code
@subsubsection Profiling or Tracing a Procedure's Code
What if you wanted to get a trace of everything that the Guile
evaluator does within a given procedure, but without Guile stopping
and waiting for your input at every step? For this requirement you
can install a trap on the procedure, as in the previous example, but
instead of @code{debug-trap} or @code{gds-debug-trap}, use the
@code{trace-trap} and @code{trace-until-exit} behaviours provided by
the @code{(ice-9 debugging trace)} module.
@lisp
guile> (use-modules (ice-9 debugging traps) (ice-9 debugging trace))
guile> (load "matrix.scm")
guile> (install-trap (make <procedure-trap>
#:procedure mkmatrix
#:behaviour (list trace-trap trace-until-exit)))
guile> (do-main 4)
| 2: [mkmatrix]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> define #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> define #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq define (debug)]
| 5: =>#f
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> define #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> define #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq define (debug)]
| 5: =>#f
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 2: (letrec ((yy 23)) (let ((x 1)) (quote this-is-a-matric)))
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 2: (let ((x 1)) (quote this-is-a-matric))
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 3: [#<procedure #f (a sym definep)> #<autoload # b7c93870> let #f]
| 4: (and (memq sym bindings) (let ...))
| 5: (memq sym bindings)
| 5: [memq let (debug)]
| 5: =>#f
| 2: [let (let # #) (# # #)]
| 2: [let (let # #) (# # #)]
| 2: =>(#@@let* (x 1) #@@let (quote this-is-a-matric))
this-is-a-matric
guile> (do-main 4)
| 2: [mkmatrix]
| 2: (letrec ((yy 23)) (let* ((x 1)) (quote this-is-a-matric)))
| 2: (let* ((x 1)) (quote this-is-a-matric))
| 2: (quote this-is-a-matric)
| 2: =>this-is-a-matric
this-is-a-matric
guile>
@end lisp
This example shows the default configuration for how each line of trace
output is formatted, which is:
@itemize
@item
the character @code{|}, a visual clue that the line is a line of trace
output, followed by
@item
a number indicating the real evaluator stack depth (where ``real'' means
not counting tail-calls), followed by
@item
a summary of the expression being evaluated (@code{(@dots{})}), the
procedure being called (@code{[@dots{}]}), or the value being returned
from an evaluation or procedure call (@code{=>@dots{}}).
@end itemize
@noindent
You can customize @code{(ice-9 debugging trace)} to show different
information in each trace line using the @code{set-trace-layout}
procedure. The next example shows how to get the source location in
each trace line instead of the stack depth.
@lisp
guile> (set-trace-layout "|~16@@a: ~a\n" trace/source trace/info)
guile> (do-main 4)
| matrix.scm:7:2: [mkmatrix]
| : (letrec ((yy 23)) (let* ((x 1)) (quote this-is-a-matric)))
| matrix.scm:3:2: (let* ((x 1)) (quote this-is-a-matric))
| matrix.scm:4:4: (quote this-is-a-matric)
| matrix.scm:4:4: =>this-is-a-matric
this-is-a-matric
guile>
@end lisp
(For anyone wondering why the first @code{(do-main 4)} call above
generates lots more trace lines than the subsequent calls: these
examples also demonstrate how the Guile evaluator ``memoizes'' code.
When Guile evaluates a source code expression for the first time, it
changes some parts of the expression so that they will be quicker to
evaluate when that expression is evaluated again; this is called
memoization. The trace output from the first @code{(do-main 4)} call
shows memoization steps, such as an internal define being transformed to
a letrec.)
@c Local Variables: @c Local Variables:
@c TeX-master: "guile.texi" @c TeX-master: "guile.texi"
@c End: @c End:

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2008
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -329,12 +329,12 @@ Signal error if module name is not resolvable.
@c FIXME::martin: Is this correct, and is there more to say? @c FIXME::martin: Is this correct, and is there more to say?
@c FIXME::martin: Define term and concept `system transformer' somewhere. @c FIXME::martin: Define term and concept `syntax transformer' somewhere.
@deffn syntax use-syntax module-name @deffn syntax use-syntax module-name
Load the module @code{module-name} and use its system Load the module @code{module-name} and use its syntax
transformer as the system transformer for the currently defined module, transformer as the syntax transformer for the currently defined module,
as well as installing it as the current system transformer. as well as installing it as the current syntax transformer.
@end deffn @end deffn
@deffn syntax @@ module-name binding-name @deffn syntax @@ module-name binding-name
@ -679,7 +679,7 @@ Guile starts up.
@item (ice-9 debug) @item (ice-9 debug)
Mikael Djurfeldt's source-level debugging support for Guile Mikael Djurfeldt's source-level debugging support for Guile
(@pxref{Debugging Features}). (@pxref{Tracing}).
@item (ice-9 expect) @item (ice-9 expect)
Actions based on matching input from a port (@pxref{Expect}). Actions based on matching input from a port (@pxref{Expect}).

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -491,7 +491,7 @@ Here is the list of reader options generated by typing
values. values.
@smalllisp @smalllisp
keywords #f Style of keyword recognition: #f or 'prefix keywords #f Style of keyword recognition: #f, 'prefix or 'postfix
case-insensitive no Convert symbols to lower case. case-insensitive no Convert symbols to lower case.
positions yes Record positions of source code expressions. positions yes Record positions of source code expressions.
copy no Copy source code expressions. copy no Copy source code expressions.
@ -613,7 +613,6 @@ way.
@var{retval} is the return value. @var{retval} is the return value.
@end deffn @end deffn
@deffn memoize-symbol-handler key cont expression env @deffn memoize-symbol-handler key cont expression env
Called when the evaluator memoizes the value of a procedure symbol Called when the evaluator memoizes the value of a procedure symbol
@ -626,6 +625,16 @@ way.
@var{retval} is the return value. @var{retval} is the return value.
@end deffn @end deffn
@deffn {Scheme Procedure} with-traps thunk
@deffnx {C Function} scm_with_traps (thunk)
Call @var{thunk} with traps enabled.
@end deffn
@deffn {Scheme Procedure} debug-object? obj
@deffnx {C Function} scm_debug_object_p (obj)
Return @code{#t} if @var{obj} is a debug object.
@end deffn
@node Debugger options @node Debugger options
@subsubsection Debugger options @subsubsection Debugger options
@ -720,7 +729,7 @@ ABORT: (misc-error)
Type "(backtrace)" to get more information. Type "(backtrace)" to get more information.
guile> (read-options 'help) guile> (read-options 'help)
keywords #f Style of keyword recognition: #f or 'prefix keywords #f Style of keyword recognition: #f, 'prefix or 'postfix
case-insensitive no Convert symbols to lower case. case-insensitive no Convert symbols to lower case.
positions yes Record positions of source code expressions. positions yes Record positions of source code expressions.
copy no Copy source code expressions. copy no Copy source code expressions.

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -267,11 +267,24 @@ Once @var{body} or @var{handler} returns, the return value is made the
@emph{exit value} of the thread and the thread is terminated. @emph{exit value} of the thread and the thread is terminated.
@end deftypefn @end deftypefn
@deffn {Scheme Procedure} thread? obj
@deffnx {C Function} scm_thread_p (obj)
Return @code{#t} iff @var{obj} is a thread; otherwise, return
@code{#f}.
@end deffn
@c begin (texi-doc-string "guile" "join-thread") @c begin (texi-doc-string "guile" "join-thread")
@deffn {Scheme Procedure} join-thread thread @deffn {Scheme Procedure} join-thread thread [timeout [timeoutval]]
@deffnx {C Function} scm_join_thread (thread)
@deffnx {C Function} scm_join_thread_timed (thread, timeout, timeoutval)
Wait for @var{thread} to terminate and return its exit value. Threads Wait for @var{thread} to terminate and return its exit value. Threads
that have not been created with @code{call-with-new-thread} or that have not been created with @code{call-with-new-thread} or
@code{scm_spawn_thread} have an exit value of @code{#f}. @code{scm_spawn_thread} have an exit value of @code{#f}. When
@var{timeout} is given, it specifies a point in time where the waiting
should be aborted. It can be either an integer as returned by
@code{current-time} or a pair as returned by @code{gettimeofday}.
When the waiting is aborted, @var{timeoutval} is returned (if it is
specified; @code{#f} is returned otherwise).
@end deffn @end deffn
@deffn {Scheme Procedure} thread-exited? thread @deffn {Scheme Procedure} thread-exited? thread
@ -285,6 +298,42 @@ If one or more threads are waiting to execute, calling yield forces an
immediate context switch to one of them. Otherwise, yield has no effect. immediate context switch to one of them. Otherwise, yield has no effect.
@end deffn @end deffn
@deffn {Scheme Procedure} cancel-thread thread
@deffnx {C Function} scm_cancel_thread (thread)
Asynchronously notify @var{thread} to exit. Immediately after
receiving this notification, @var{thread} will call its cleanup handler
(if one has been set) and then terminate, aborting any evaluation that
is in progress.
Because Guile threads are isomorphic with POSIX threads, @var{thread}
will not receive its cancellation signal until it reaches a cancellation
point. See your operating system's POSIX threading documentation for
more information on cancellation points; note that in Guile, unlike
native POSIX threads, a thread can receive a cancellation notification
while attempting to lock a mutex.
@end deffn
@deffn {Scheme Procedure} set-thread-cleanup! thread proc
@deffnx {C Function} scm_set_thread_cleanup_x (thread, proc)
Set @var{proc} as the cleanup handler for the thread @var{thread}.
@var{proc}, which must be a thunk, will be called when @var{thread}
exits, either normally or by being canceled. Thread cleanup handlers
can be used to perform useful tasks like releasing resources, such as
locked mutexes, when thread exit cannot be predicted.
The return value of @var{proc} will be set as the @emph{exit value} of
@var{thread}.
To remove a cleanup handler, pass @code{#f} for @var{proc}.
@end deffn
@deffn {Scheme Procedure} thread-cleanup thread
@deffnx {C Function} scm_thread_cleanup (thread)
Return the cleanup handler currently installed for the thread
@var{thread}. If no cleanup handler is currently installed,
thread-cleanup returns @code{#f}.
@end deffn
Higher level thread procedures are available by loading the Higher level thread procedures are available by loading the
@code{(ice-9 threads)} module. These provide standardized @code{(ice-9 threads)} module. These provide standardized
thread creation. thread creation.
@ -326,20 +375,54 @@ Acquiring requisite mutexes in a fixed order (like always A before B)
in all threads is one way to avoid such problems. in all threads is one way to avoid such problems.
@sp 1 @sp 1
@deffn {Scheme Procedure} make-mutex @deffn {Scheme Procedure} make-mutex . flags
@deffnx {C Function} scm_make_mutex () @deffnx {C Function} scm_make_mutex ()
Return a new standard mutex. It is initially unlocked. @deffnx {C Function} scm_make_mutex_with_flags (SCM flags)
Return a new mutex. It is initially unlocked. If @var{flags} is
specified, it must be a list of symbols specifying configuration flags
for the newly-created mutex. The supported flags are:
@table @code
@item unchecked-unlock
Unless this flag is present, a call to `unlock-mutex' on the returned
mutex when it is already unlocked will cause an error to be signalled.
@item allow-external-unlock
Allow the returned mutex to be unlocked by the calling thread even if
it was originally locked by a different thread.
@item recursive
The returned mutex will be recursive.
@end table
@end deffn
@deffn {Scheme Procedure} mutex? obj
@deffnx {C Function} scm_mutex_p (obj)
Return @code{#t} iff @var{obj} is a mutex; otherwise, return
@code{#f}.
@end deffn @end deffn
@deffn {Scheme Procedure} make-recursive-mutex @deffn {Scheme Procedure} make-recursive-mutex
@deffnx {C Function} scm_make_recursive_mutex () @deffnx {C Function} scm_make_recursive_mutex ()
Create a new recursive mutex. It is initialloy unlocked. Create a new recursive mutex. It is initially unlocked. Calling this
function is equivalent to calling `make-mutex' and specifying the
@code{recursive} flag.
@end deffn @end deffn
@deffn {Scheme Procedure} lock-mutex mutex @deffn {Scheme Procedure} lock-mutex mutex [timeout [owner]]
@deffnx {C Function} scm_lock_mutex (mutex) @deffnx {C Function} scm_lock_mutex (mutex)
Lock @var{mutex}. If the mutex is already locked by another thread @deffnx {C Function} scm_lock_mutex_timed (mutex, timeout, owner)
then block and return only when @var{mutex} has been acquired. Lock @var{mutex}. If the mutex is already locked, then block and
return only when @var{mutex} has been acquired.
When @var{timeout} is given, it specifies a point in time where the
waiting should be aborted. It can be either an integer as returned
by @code{current-time} or a pair as returned by @code{gettimeofday}.
When the waiting is aborted, @code{#f} is returned.
When @var{owner} is given, it specifies an owner for @var{mutex} other
than the calling thread. @var{owner} may also be @code{#f},
indicating that the mutex should be locked but left unowned.
For standard mutexes (@code{make-mutex}), and error is signalled if For standard mutexes (@code{make-mutex}), and error is signalled if
the thread has itself already locked @var{mutex}. the thread has itself already locked @var{mutex}.
@ -349,6 +432,10 @@ itself already locked @var{mutex}, then a further @code{lock-mutex}
call increments the lock count. An additional @code{unlock-mutex} call increments the lock count. An additional @code{unlock-mutex}
will be required to finally release. will be required to finally release.
If @var{mutex} was locked by a thread that exited before unlocking it,
the next attempt to lock @var{mutex} will succeed, but
@code{abandoned-mutex-error} will be signalled.
When a system async (@pxref{System asyncs}) is activated for a thread When a system async (@pxref{System asyncs}) is activated for a thread
blocked in @code{lock-mutex}, the wait is interrupted and the async is blocked in @code{lock-mutex}, the wait is interrupted and the async is
executed. When the async returns, the wait resumes. executed. When the async returns, the wait resumes.
@ -367,10 +454,46 @@ If @var{mutex} is locked by some other thread then nothing is done and
the return is @code{#f}. the return is @code{#f}.
@end deffn @end deffn
@deffn {Scheme Procedure} unlock-mutex mutex @deffn {Scheme Procedure} unlock-mutex mutex [condvar [timeout]]
@deffnx {C Function} scm_unlock_mutex (mutex) @deffnx {C Function} scm_unlock_mutex (mutex)
Unlock @var{mutex}. An error is signalled if @var{mutex} is not @deffnx {C Function} scm_unlock_mutex_timed (mutex, condvar, timeout)
locked by the calling thread. Unlock @var{mutex}. An error is signalled if @var{mutex} is not locked
and was not created with the @code{unchecked-unlock} flag set, or if
@var{mutex} is locked by a thread other than the calling thread and was
not created with the @code{allow-external-unlock} flag set.
If @var{condvar} is given, it specifies a condition variable upon
which the calling thread will wait to be signalled before returning.
(This behavior is very similar to that of
@code{wait-condition-variable}, except that the mutex is left in an
unlocked state when the function returns.)
When @var{timeout} is also given, it specifies a point in time where
the waiting should be aborted. It can be either an integer as
returned by @code{current-time} or a pair as returned by
@code{gettimeofday}. When the waiting is aborted, @code{#f} is
returned. Otherwise the function returns @code{#t}.
@end deffn
@deffn {Scheme Procedure} mutex-owner mutex
@deffnx {C Function} scm_mutex_owner (mutex)
Return the current owner of @var{mutex}, in the form of a thread or
@code{#f} (indicating no owner). Note that a mutex may be unowned but
still locked.
@end deffn
@deffn {Scheme Procedure} mutex-level mutex
@deffnx {C Function} scm_mutex_level (mutex)
Return the current lock level of @var{mutex}. If @var{mutex} is
currently unlocked, this value will be 0; otherwise, it will be the
number of times @var{mutex} has been recursively locked by its current
owner.
@end deffn
@deffn {Scheme Procedure} mutex-locked? mutex
@deffnx {C Function} scm_mutex_locked_p (mutex)
Return @code{#t} if @var{mutex} is locked, regardless of ownership;
otherwise, return @code{#f}.
@end deffn @end deffn
@deffn {Scheme Procedure} make-condition-variable @deffn {Scheme Procedure} make-condition-variable
@ -378,6 +501,12 @@ locked by the calling thread.
Return a new condition variable. Return a new condition variable.
@end deffn @end deffn
@deffn {Scheme Procedure} condition-variable? obj
@deffnx {C Function} scm_condition_variable_p (obj)
Return @code{#t} iff @var{obj} is a condition variable; otherwise,
return @code{#f}.
@end deffn
@deffn {Scheme Procedure} wait-condition-variable condvar mutex [time] @deffn {Scheme Procedure} wait-condition-variable condvar mutex [time]
@deffnx {C Function} scm_wait_condition_variable (condvar, mutex, time) @deffnx {C Function} scm_wait_condition_variable (condvar, mutex, time)
Wait until @var{condvar} has been signalled. While waiting, Wait until @var{condvar} has been signalled. While waiting,

View file

@ -8,10 +8,10 @@
@node Autoconf Support @node Autoconf Support
@chapter Autoconf Support @chapter Autoconf Support
When Guile is installed, a set of autoconf macros is also installed as When Guile is installed, a pkg-config description file and a set of
PREFIX/share/aclocal/guile.m4. This chapter documents the macros provided in Autoconf macros is installed. This chapter documents pkg-config and
that file, as well as the high-level guile-tool Autofrisk. @xref{Top,The GNU Autoconf support, as well as the high-level guile-tool Autofrisk.
Autoconf Manual,,autoconf}, for more info. @xref{Top,The GNU Autoconf Manual,,autoconf}, for more info.
@menu @menu
* Autoconf Background:: Why use autoconf? * Autoconf Background:: Why use autoconf?
@ -45,7 +45,38 @@ checks.
@node Autoconf Macros @node Autoconf Macros
@section Autoconf Macros @section Autoconf Macros
The macro names all begin with "GUILE_". @cindex pkg-config
@cindex autoconf
GNU Guile provides a @dfn{pkg-config} description file, installed as
@file{@var{prefix}/lib/pkgconfig/guile-1.8.pc}, which contains all the
information necessary to compile and link C applications that use Guile.
The @code{pkg-config} program is able to read this file and provide this
information to application programmers; it can be obtained at
@url{http://pkg-config.freedesktop.org/}.
The following command lines give respectively the C compilation and link
flags needed to build Guile-using programs:
@example
pkg-config guile-1.8 --cflags
pkg-config guile-1.8 --libs
@end example
To ease use of pkg-config with Autoconf, pkg-config comes with a
convenient Autoconf macro. The following example looks for Guile and
sets the @code{GUILE_CFLAGS} and @code{GUILE_LIBS} variables
accordingly, or prints an error and exits if Guile was not found:
@findex PKG_CHECK_MODULES
@example
PKG_CHECK_MODULES([GUILE], [guile-1.8])
@end example
Guile comes with additional Autoconf macros providing more information,
installed as @file{@var{prefix}/share/aclocal/guile.m4}. Their names
all begin with @code{GUILE_}.
@c see Makefile.am @c see Makefile.am
@include autoconf-macros.texi @include autoconf-macros.texi

View file

@ -138,7 +138,7 @@ x
@comment The title is printed in a large font. @comment The title is printed in a large font.
@title Guile Reference Manual @title Guile Reference Manual
@subtitle Edition @value{MANUAL-EDITION}, for use with Guile @value{VERSION} @subtitle Edition @value{MANUAL-EDITION}, for use with Guile @value{VERSION}
@c @subtitle $Id: guile.texi,v 1.48 2006-11-18 18:14:55 civodul Exp $ @c @subtitle $Id: guile.texi,v 1.49 2008-03-19 22:51:23 ossau Exp $
@c See preface.texi for the list of authors @c See preface.texi for the list of authors
@author The Guile Developers @author The Guile Developers
@ -177,6 +177,8 @@ x
* Guile Modules:: * Guile Modules::
* Autoconf Support::
Appendices Appendices
* Data Representation:: All the details. * Data Representation:: All the details.
@ -222,7 +224,6 @@ etc. that make up Guile's application programming interface (API),
* Guile Scripting:: How to write Guile scripts. * Guile Scripting:: How to write Guile scripts.
* Using Guile Interactively:: Guile's REPL features. * Using Guile Interactively:: Guile's REPL features.
* Using Guile in Emacs:: Guile and Emacs. * Using Guile in Emacs:: Guile and Emacs.
* Debugging Features:: Features for finding errors.
* Further Reading:: Where to find out more about Scheme. * Further Reading:: Where to find out more about Scheme.
@end menu @end menu
@ -230,7 +231,6 @@ etc. that make up Guile's application programming interface (API),
@include scheme-intro.texi @include scheme-intro.texi
@include scheme-scripts.texi @include scheme-scripts.texi
@include scheme-using.texi @include scheme-using.texi
@include scheme-debugging.texi
@include scheme-reading.texi @include scheme-reading.texi
@node Programming in C @node Programming in C
@ -351,6 +351,7 @@ available through both Scheme and C interfaces.
* Buffered Input:: Ports made from a reader function. * Buffered Input:: Ports made from a reader function.
* Expect:: Controlling interactive programs with Guile. * Expect:: Controlling interactive programs with Guile.
* The Scheme shell (scsh):: Using scsh interfaces in Guile. * The Scheme shell (scsh):: Using scsh interfaces in Guile.
* Tracing:: Tracing program execution.
@end menu @end menu
@include slib.texi @include slib.texi
@ -361,6 +362,9 @@ available through both Scheme and C interfaces.
@include misc-modules.texi @include misc-modules.texi
@include expect.texi @include expect.texi
@include scsh.texi @include scsh.texi
@include scheme-debugging.texi
@include autoconf.texi
@include data-rep.texi @include data-rep.texi
@include fdl.texi @include fdl.texi

View file

@ -474,7 +474,7 @@ multiple threads using them concurrently. This means that there is no
risk of the internal data structures of libguile becoming corrupted in risk of the internal data structures of libguile becoming corrupted in
such a way that the process crashes. such a way that the process crashes.
A program might still produce non-sensical results, though. Taking A program might still produce nonsensical results, though. Taking
hashtables as an example, Guile guarantees that you can use them from hashtables as an example, Guile guarantees that you can use them from
multiple threads concurrently and a hashtable will always remain a valid multiple threads concurrently and a hashtable will always remain a valid
hashtable and Guile will not crash when you access it. It does not hashtable and Guile will not crash when you access it. It does not

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -956,6 +956,11 @@ If @var{suffix} is provided, and is equal to the end of
@end lisp @end lisp
@end deffn @end deffn
@deffn {Scheme Procedure} file-exists? filename
Return @code{#t} if the file named @var{filename} exists, @code{#f} if
not.
@end deffn
@node User Information @node User Information
@subsection User Information @subsection User Information
@ -1259,27 +1264,8 @@ formatting.
If @code{setlocale} has been called (@pxref{Locales}), month and day If @code{setlocale} has been called (@pxref{Locales}), month and day
names are from the current locale and in the locale character set. names are from the current locale and in the locale character set.
Note that @samp{%Z} might print the @code{tm:zone} in @var{tm} or it Note that @samp{%Z} always ignores the @code{tm:zone} in @var{tm};
might print just the current zone (@code{tzset} above). A GNU system instead it prints just the current zone (@code{tzset} above).
prints @code{tm:zone}, a strict C99 system like NetBSD prints the
current zone. Perhaps in the future Guile will try to get
@code{tm:zone} used always.
@c
@c The issue in the above is not just whether tm_zone exists in
@c struct tm, but whether libc feels it should read it. Being a
@c non-C99 field, a strict C99 program won't know to set it, quite
@c likely leaving garbage there. NetBSD, which has the field,
@c therefore takes the view that it mustn't read it. See the PR
@c about this at
@c
@c http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=21722
@c
@c Uniformly making tm:zone used on all systems (all those which have
@c %Z at all of course) might be nice (either mung TZ and tzset, or
@c mung tzname[]). On the other hand it would make us do more than
@c C99 says, and we really don't want to get intimate with the gory
@c details of libc time funcs, no more than can be helped.
@c
@end deffn @end deffn
@deffn {Scheme Procedure} strptime format string @deffn {Scheme Procedure} strptime format string

View file

@ -5,280 +5,8 @@
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@page @page
@node Debugging Features
@section Debugging Features
Guile includes debugging tools to help you work out what is going wrong
when a program signals an error or behaves differently to how you would
expect. This chapter describes how to use these tools.
Broadly speaking, Guile's debugging support allows you to do two things:
@itemize @bullet
@item
specify @dfn{breakpoints} --- points in the execution of a program where
execution should pause so you can see what is going on
@item
examine in detail the ``scene of the crime'' --- in other words, the
execution context at a breakpoint, or when the last error occurred.
@end itemize
@noindent
The details are more complex and more powerful @dots{}
@menu
* Examples::
* Intro to Breakpoints:: Setting and manipulating them.
* Tracing:: Tracing program execution.
@end menu
@node Examples
@subsection Examples
Before we dive into the details and reference documentation of
guile-debugging's features, this chapter sets the scene by presenting a
few examples of what you can do with guile-debugging.
@menu
* Single Stepping through a Procedure's Code::
* Profiling or Tracing a Procedure's Code::
@end menu
@node Single Stepping through a Procedure's Code
@subsubsection Single Stepping through a Procedure's Code
A good way to explore in detail what a Scheme procedure does is to set a
breakpoint on it and then single step through what it does. To do this,
use the @code{break-in} procedure from the @code{(ice-9 debugging
breakpoints)} module with the @code{debug-trap} behaviour from
@code{(ice-9 debugging ice-9-debugger-extensions)}. The following
sample session illustrates this. It assumes that the file
@file{matrix.scm} defines a procedure @code{mkmatrix}, which is the one
we want to explore, and another procedure @code{do-main} which calls
@code{mkmatrix}.
@lisp
$ /usr/bin/guile -q
guile> (use-modules (ice-9 debugger)
(ice-9 debugging ice-9-debugger-extensions)
(ice-9 debugging breakpoints))
guile> (load "matrix.scm")
guile> (break-in 'mkmatrix #:behaviour debug-trap)
#<<break-in> 808cb70>
guile> (do-main 4)
This is the Guile debugger -- for help, type `help'.
There are 3 frames on the stack.
Frame 2 at matrix.scm:8:3
[mkmatrix]
debug> next
Frame 3 at matrix.scm:4:3
(let ((x 1)) (quote this-is-a-matric))
debug> info frame
Stack frame: 3
This frame is an evaluation.
The expression being evaluated is:
matrix.scm:4:3:
(let ((x 1)) (quote this-is-a-matric))
debug> next
Frame 3 at matrix.scm:5:21
(quote this-is-a-matric)
debug> bt
In unknown file:
?: 0* [primitive-eval (do-main 4)]
In standard input:
4: 1* [do-main 4]
In matrix.scm:
8: 2 [mkmatrix]
...
5: 3 (quote this-is-a-matric)
debug> quit
this-is-a-matric
guile>
@end lisp
Or you can use guile-debugging's Emacs interface (GDS), by using the
module @code{(ice-9 gds-client)} instead of @code{(ice-9 debugger)} and
@code{(ice-9 debugging ice-9-debugger-extensions)}, and changing
@code{debug-trap} to @code{gds-debug-trap}. Then the stack and
corresponding source locations are displayed in Emacs instead of on the
Guile command line.
@node Profiling or Tracing a Procedure's Code
@subsubsection Profiling or Tracing a Procedure's Code
What if you wanted to get a trace of everything that the Guile evaluator
does within a given procedure, but without Guile stopping and waiting
for your input at every step? In this case you set a breakpoint on the
procedure using @code{break-in} (the same as in the previous example),
but use the @code{trace-trap} and @code{trace-until-exit} behaviours
provided by the @code{(ice-9 debugging trace)} module.
@lisp
guile> (use-modules (ice-9 debugging breakpoints) (ice-9 debugging trace))
guile> (load "matrix.scm")
guile> (break-in 'mkmatrix #:behaviour (list trace-trap trace-until-exit))
#<<break-in> 808b430>
guile> (do-main 4)
| 2: [mkmatrix]
| 3: [define (define yy 23) ((()) #<eval-closure 4028db30>)]
| 3: [define (define yy 23) ((()) #<eval-closure 4028db30>)]
| 3: =>(#@@define yy 23)
| 3: [let (let # #) (# #)]
| 3: [let (let # #) (# #)]
| 3: =>(#@@let* (x 1) #@@let (quote this-is-a-matric))
| 2: (letrec ((yy 23)) (let ((x 1)) (quote this-is-a-matric)))
| 3: [let (let # #) (# # #)]
| 3: [let (let # #) (# # #)]
| 3: =>(#@@let* (x 1) #@@let (quote this-is-a-matric))
| 2: (let ((x 1)) (quote this-is-a-matric))
| 3: [quote (quote this-is-a-matric) ((x . 1) ((yy) 23) (()) ...)]
| 3: [quote (quote this-is-a-matric) ((x . 1) ((yy) 23) (()) ...)]
| 3: =>(#@@quote this-is-a-matric)
| 2: (quote this-is-a-matric)
| 2: =>this-is-a-matric
this-is-a-matric
guile> (do-main 4)
| 2: [mkmatrix]
| 2: (letrec ((yy 23)) (let ((x 1)) (quote this-is-a-matric)))
| 2: (let ((x 1)) (quote this-is-a-matric))
| 2: (quote this-is-a-matric)
| 2: =>this-is-a-matric
this-is-a-matric
guile>
@end lisp
This example shows the default configuration for how each line of trace
output is formatted, which is:
@itemize
@item
the character @code{|}, a visual clue that the line is a line of trace
output, followed by
@item
a number indicating the real evaluator stack depth (where ``real'' means
not counting tail-calls), followed by
@item
a summary of the expression being evaluated (@code{(@dots{})}), the
procedure being called (@code{[@dots{}]}), or the value being returned
from an evaluation or procedure call (@code{=>@dots{}}).
@end itemize
@noindent
You can customize @code{(ice-9 debugging trace)} to show different
information in each trace line using the @code{set-trace-layout}
procedure. The next example shows how to get the source location in
each trace line instead of the stack depth.
@lisp
guile> (set-trace-layout "|~16@@a: ~a\n" trace/source trace/info)
guile> (do-main 4)
| matrix.scm:7:2: [mkmatrix]
| : (letrec ((yy 23)) (let ((x 1)) (quote this-is-a-matric)))
| matrix.scm:3:2: (let ((x 1)) (quote this-is-a-matric))
| matrix.scm:4:20: (quote this-is-a-matric)
| matrix.scm:4:20: =>this-is-a-matric
this-is-a-matric
guile>
@end lisp
(For anyone wondering why the first @code{(do-main 4)} call above
generates lots more trace lines than the subsequent calls: these
examples also demonstrate how the Guile evaluator ``memoizes'' code.
When Guile evaluates a source code expression for the first time, it
changes some parts of the expression so that they will be quicker to
evaluate when that expression is evaluated again; this is called
memoization. The trace output from the first @code{(do-main 4)} call
shows memoization steps, such as an internal define being transformed to
a letrec.)
@node Intro to Breakpoints
@subsection Intro to Breakpoints
Sometimes a piece of Scheme code isn't working and you'd like to go
through it step by step. You can do this in Guile by setting a
breakpoint at the start of the relevant code, and then using the command
line or Emacs interface to step through it.
A breakpoint can be specified by procedure name or by location -- the
relevant code's file name, line number and column number. For details
please see the full documentation for @code{break-in} and
@code{break-at} in @ref{Intro to Breakpoints}.
When you set a breakpoint, you can specify any ``behaviour'' you like
for what should happen when the breakpoint is hit; a breakpoint
``behaviour'' is just a Scheme procedure with the right signature.
@menu
* Breakpoints Overview::
@end menu
@node Breakpoints Overview
@subsubsection How Breakpoints Work and Why They Are Useful
Often, debugging the last error is not enough to tell you what went
wrong. For example, the root cause of the error may have arisen a long
time before the error was signalled, in which case the execution context
of the error is too late to be useful. Or your program might not signal
an error at all, just return an unexpected result or have some incorrect
side effect.
In many such cases, it's useful to pause the program at or before the
point where you suspect the problem arises. Then you can explore the
stack, display the values of key variables, and generally check that the
state of the program is as you expect. If all is well, you can let the
program continue running normally, or step more slowly through each
expression that the Scheme interpreter evaluates. Single-stepping may
reveal that the program is going through blocks of code that you didn't
intend --- a useful data point for understanding what the underlying
problem is.
Telling Guile where or when to pause a program is called @dfn{setting a
breakpoint}. When a breakpoint is hit, Guile's default behaviour is to
enter the interactive debugger, where there are now two sets of commands
available:
@itemize @bullet
@item
all the commands as described for last error debugging
(@pxref{Interactive Debugger}), which allow you to explore the stack and
so on
@item
additional commands for continuing program execution in various ways:
@code{next}, @code{step}, @code{finish}, @code{trace-finish} and
@code{continue}.
@end itemize
Use of the interactive debugger is described in @ref{Interactive
Debugger}.
@node Tracing @node Tracing
@subsection Tracing @section Tracing
Tracing has already been described as a breakpoint behaviour, but we
mention it again here because it is so useful, and because Guile
actually now has @emph{two} mechanisms for tracing, and its worth
clarifying the differences between them.
@menu
* Old Tracing:: Tracing provided by (ice-9 debug).
* New Tracing:: Breakpoint-based tracing.
* Tracing Compared:: Differences between old and new.
@end menu
@node Old Tracing
@subsubsection Tracing Provided by @code{(ice-9 debug)}
The @code{(ice-9 debug)} module implements tracing of procedure The @code{(ice-9 debug)} module implements tracing of procedure
applications. When a procedure is @dfn{traced}, it means that every applications. When a procedure is @dfn{traced}, it means that every
@ -391,128 +119,6 @@ there is no need for Guile to create a new stack frame for each
iteration. Tracing reveals this optimization in operation. iteration. Tracing reveals this optimization in operation.
@node New Tracing
@subsubsection Breakpoint-based Tracing
Guile's newer mechanism implements tracing as an optional behaviour for
any kind of breakpoint.
To trace a procedure (in the same kind of way as the older tracing), use
the @code{trace!} procedure to set a procedure breakpoint with
@code{trace-here} behaviour:
@lisp
(trace! fact1)
@print{}
Set breakpoint 1: [fact1]
@result{}
#<<procedure-breakpoint> 40337bf0>
(fact1 4)
@print{}
| [fact1 4]
| | [fact1 3]
| | | [fact1 2]
| | | | [fact1 1]
| | | | | [fact1 0]
| | | | | 1
| | | | 2
| | | 6
| | 24
| 24
@result{}
24
@end lisp
To trace evaluation of a source expression, evaluate code containing a
breakpoint marker @code{##} in the appropriate place, then use
@code{set-breakpoint} to change the behaviour of the new breakpoint to
@code{trace-here}:
@lisp
(define (fact1 n)
(if ##(= n 0)
1
(* n (fact1 (- n 1)))))
@print{}
Set breakpoint 4: standard input:13:9: (= n 0)
(use-modules (ice-9 debugger behaviour))
(set-breakpoint! trace-here 4)
@print{}
Breakpoint 4: standard input:13:9: (= n 0)
enabled? = #t
behaviour = #<procedure trace-here ()>
(fact1 4)
@print{}
| (= n 0)
| #f
| (= n 0)
| #f
| (= n 0)
| #f
| (= n 0)
| #f
| (= n 0)
| #t
@result{}
24
@end lisp
@noindent
(Note --- this example reveals a bug: each occurrence of @code{(= n 0)}
should be shown indented with respect to the one before it, as
@code{fact1} does not call itself tail-recursively.)
You can also give a breakpoint the @code{trace-subtree} behaviour, which
means to trace the breakpoint location itself plus any evaluations and
applications that occur below it in the call stack. In the following
example, this allows us to see the evaluated arguments that are being
compared by the @code{=} procedure:
@lisp
(set-breakpoint! trace-subtree 4)
@print{}
Breakpoint 4: standard input:13:9: (= n 0)
enabled? = #t
behaviour = #<procedure trace-subtree ()>
(fact1 4)
@print{}
| (= n 0)
| [= 4 0]
| #f
| (= n 0)
| [= 3 0]
| #f
| (= n 0)
| [= 2 0]
| #f
| (= n 0)
| [= 1 0]
| #f
| (= n 0)
| [= 0 0]
| #t
@result{}
24
@end lisp
@node Tracing Compared
@subsubsection Differences Between Old and New Tracing Mechanisms
The newer tracing mechanism is more general and so more powerful than
the older one: it works for expressions as well as procedure
applications, and it implements the useful @code{trace-subtree}
behaviour as well as the more traditional @code{trace-here}.
The older mechanism will probably become obsolete eventually, but it's
worth keeping it around for a while until we are sure that the new
mechanism is correct and does what programmers need.
@c Local Variables: @c Local Variables:
@c TeX-master: "guile.texi" @c TeX-master: "guile.texi"
@c End: @c End:

View file

@ -163,10 +163,10 @@ The interactive debugger is documented further in the following section.
@node Interactive Debugger @node Interactive Debugger
@subsection Using the Interactive Debugger @subsection Using the Interactive Debugger
Guile's interactive debugger is a command line application that accepts Guile's interactive debugger is a command line application that
commands from you for examining the stack and, if at a breakpoint, for accepts commands from you for examining the stack and, if stopped at a
continuing program execution in various ways. Unlike in the normal trap, for continuing program execution in various ways. Unlike in the
Guile REPL, commands are typed mostly without parentheses. normal Guile REPL, commands are typed mostly without parentheses.
When you first enter the debugger, it introduces itself with a message When you first enter the debugger, it introduces itself with a message
like this: like this:
@ -359,15 +359,17 @@ debugger to continue.)
@node Using Guile in Emacs @node Using Guile in Emacs
@section Using Guile in Emacs @section Using Guile in Emacs
There are quite a few options for working on Guile Scheme code in @cindex GDS
Emacs. The simplest options are to use Emacs's standard @cindex Emacs
@code{scheme-mode} for editing code, and to run the interpreter when you There are several options for working on Guile Scheme code in Emacs.
need it by typing ``guile'' at the prompt of a @code{*shell*} buffer, The simplest are to use Emacs's standard @code{scheme-mode} for
but there are Emacs libraries available which add various bells and editing code, and to run the interpreter when you need it by typing
whistles to this. The following diagram shows these libraries and how ``guile'' at the prompt of a @code{*shell*} buffer, but there are
they relate to each other, with the arrows indicating ``builds on'' or Emacs libraries available which add various bells and whistles to
``extends''. For example, the Quack library builds on cmuscheme, which this. The following diagram shows these libraries and how they relate
in turn builds on the standard scheme mode. to each other, with the arrows indicating ``builds on'' or
``extends''. For example, the Quack library builds on cmuscheme,
which in turn builds on the standard scheme mode.
@example @example
scheme scheme
@ -408,25 +410,24 @@ interpreters and remembers which one you used last time; and so on.
Quack is available from @uref{http://www.neilvandyke.org/quack}. Quack is available from @uref{http://www.neilvandyke.org/quack}.
@dfn{GDS}, written by Neil Jerram, also builds on the scheme/cmuscheme @dfn{GDS}, written by Neil Jerram, also builds on the scheme/cmuscheme
combination, but with a fundamental change to the way that Scheme code combination, but with a change to the way that Scheme code fragments
fragments are sent to the interpreter for evaluation. cmuscheme and are sent to the interpreter for evaluation. cmuscheme and Quack send
Quack send code fragments to the interpreter's standard input, on the code fragments to the interpreter's standard input, on the assumption
assumption that the interpreter is expecting to read Scheme expressions that the interpreter is expecting to read Scheme expressions there,
there, and then monitor the interpreter's standard output to infer what and then monitor the interpreter's standard output to infer what the
the result of the evaluation is. GDS doesn't use standard input and result of the evaluation is. GDS doesn't use standard input and
output like this. Instead, it sets up a socket connection between the output like this. Instead, it sets up a socket connection between the
Scheme interpreter and Emacs, and sends and receives messages using a Scheme interpreter and Emacs, and sends and receives messages using a
simple protocol through this socket. The messages include requests to simple protocol through this socket. The messages include requests to
evaluate Scheme code, and responses conveying the results of an evaluate Scheme code, and responses conveying the results of an
evaluation, thus providing similar function to cmuscheme or Quack. They evaluation, thus providing similar function to cmuscheme or Quack.
also include requests for setting breakpoints, stack exploration and They also include requests for stack exploration and debugging, which
debugging, which go beyond what cmuscheme or Quack can do. The price of go beyond what cmuscheme or Quack can do. The price of this extra
this extra power, however, is that GDS is Guile-specific. GDS requires power, however, is that GDS is Guile-specific. GDS requires the
the Scheme interpreter, or any program that GDS is debugging, to run Scheme interpreter to run some GDS-specific library code; currently
some GDS-specific library code; currently this code is written as a this code is written as a Guile module and uses features that are
Guile module and uses a lot of debugging-related features that are
specific to Guile. GDS is now included in the Guile distribution; for specific to Guile. GDS is now included in the Guile distribution; for
previous Guile releases (1.8.x and earlier) it can be obtained as part previous Guile releases (1.8.4 and earlier) it can be obtained as part
of the @code{guile-debugging} package from of the @code{guile-debugging} package from
@uref{http://www.ossau.uklinux.net/guile}. @uref{http://www.ossau.uklinux.net/guile}.
@ -540,7 +541,7 @@ Emacs. This code, consisting of the installed files @file{gds.el} and
@file{gds-server.el}, is responsible for displaying information from @file{gds-server.el}, is responsible for displaying information from
Guile in Emacs windows, and for responding to Emacs commands and Guile in Emacs windows, and for responding to Emacs commands and
keystrokes by sending instructions back to the Guile program being keystrokes by sending instructions back to the Guile program being
debugged. worked on.
@item @item
The GDS @dfn{server} code is written in Scheme and runs as an Emacs The GDS @dfn{server} code is written in Scheme and runs as an Emacs
@ -584,12 +585,12 @@ The data exchanged between client and server components, and between
server and interface, is a sequence of sexps (parenthesised expressions) server and interface, is a sequence of sexps (parenthesised expressions)
that are designed so as to be directly readable by both Scheme and Emacs that are designed so as to be directly readable by both Scheme and Emacs
Lisp. The use of a TCP connection means that the server and Emacs Lisp. The use of a TCP connection means that the server and Emacs
interface can theoretically be on a different computer from the programs interface can theoretically be on a different computer from the client
being debugged, but in practice there are currently two problems with programs, but in practice there are currently two problems with
this. Firstly the GDS API doesn't provide any way of specifying a this. Firstly the GDS API doesn't provide any way of specifying a
non-local server to connect to, and secondly there is no security or non-local server to connect to, and secondly there is no security or
authentication mechanism in the GDS protocol. These are issues that authentication mechanism in the GDS protocol. These are issues that
should be addressed in the near future. should be addressed in the future.
@node GDS Getting Started @node GDS Getting Started
@ -620,7 +621,7 @@ and the @code{gds-debug} buffer will contain a Scheme backtrace ending
with the message: with the message:
@lisp @lisp
no code for module (ossau gds-server) no code for module (ice-9 gds-server)
@end lisp @end lisp
@noindent @noindent
@ -645,10 +646,10 @@ Emacs to open the file @file{gds-tutorial.txt} (which should have been
installed as part of Guile, perhaps under @file{/usr/share/doc/guile}), installed as part of Guile, perhaps under @file{/usr/share/doc/guile}),
and then follow the steps in that file. and then follow the steps in that file.
When you want to use GDS to explore or debug an independent Guile When you want to use GDS to work on an independent Guile
application, you need to add something to that application's Scheme code application, you need to add something to that application's Scheme code
to cause it to connect to and interact with GDS at the right times. The to cause it to connect to and interact with GDS at the right times. The
following subsections describe the various ways of doing this. following subsections describe the ways of doing this.
@subsubsection Setting Specific Breakpoints @subsubsection Setting Specific Breakpoints
@ -667,10 +668,10 @@ the following.
@end lisp @end lisp
@noindent @noindent
The @code{#:behaviour gds-debug-trap} clauses mean to use GDS to display The @code{#:behaviour gds-debug-trap} clauses mean to use GDS to
the stack when one of these breakpoints is hit. For more on display the stack when one of these breakpoints is hit. For more on
breakpoints, @code{break-in} and @code{break-at}, see @ref{Intro to breakpoints, @code{break-in} and @code{break-at}, see
Breakpoints}. @ref{Breakpoints}.
@subsubsection Setting GDS-managed Breakpoints @subsubsection Setting GDS-managed Breakpoints
@ -723,7 +724,7 @@ is pre-1.8) around the code of interest like this:
(gds-debug-trap (throw->trap-context key args)))) (gds-debug-trap (throw->trap-context key args))))
@end lisp @end lisp
In all cases you will need to use the @code{(ice-9 gds-client)} and Either way, you will need to use the @code{(ice-9 gds-client)} and
@code{(ice-9 debugging traps)} modules. @code{(ice-9 debugging traps)} modules.
Two special cases of this are the lazy-catch that the Guile REPL code Two special cases of this are the lazy-catch that the Guile REPL code
@ -738,7 +739,6 @@ procedure as follows.
@lisp @lisp
(use-modules (ice-9 gds-client) (use-modules (ice-9 gds-client)
(ice-9 debugging traps)) (ice-9 debugging traps))
(on-lazy-handler-dispatch gds-debug-trap) (on-lazy-handler-dispatch gds-debug-trap)
@end lisp @end lisp
@ -787,16 +787,12 @@ This approach is not yet implemented, though.
@subsubsection Utility Guile Implementation @subsubsection Utility Guile Implementation
We conclude this subsection with an aside, by noting that the The ``utility'' Guile client mentioned above is a simple combination
``utility'' Guile client described above is nothing more than a of the mechanisms that we have just described. In fact the code for
combination of the previous options. the utility Guile client is essentially just this:
To be precise, the code for the utility Guile client is essentially just
this:
@lisp @lisp
(use-modules (ice-9 gds-client)) (use-modules (ice-9 gds-client))
(set-gds-breakpoints) (set-gds-breakpoints)
(named-module-use! '(guile-user) '(ice-9 session)) (named-module-use! '(guile-user) '(ice-9 session))
(gds-accept-input #f)) (gds-accept-input #f))
@ -805,17 +801,22 @@ this:
@code{set-gds-breakpoints} works as already described. The @code{set-gds-breakpoints} works as already described. The
@code{named-module-use!} line ensures that the client can process @code{named-module-use!} line ensures that the client can process
@code{help} and @code{apropos} expressions, to implement lookups in @code{help} and @code{apropos} expressions, to implement lookups in
Guile's online help. The @code{#f} parameter to @code{gds-accept-input} Guile's online help. The @code{#f} parameter to
means that the @code{continue} instruction will not cause the @code{gds-accept-input} means that the @code{continue} instruction
instruction loop to exit, which makes sense here because the utility will not cause the instruction loop to exit, which makes sense here
client has nothing to do except to process GDS instructions. because the utility client has nothing to do except to process GDS
instructions.
(The utility client does not use @code{on-lazy-handler-dispatch}, The utility client does not use @code{on-lazy-handler-dispatch} at its
because it has its own mechanism for catching and reporting exceptions top level, because it has its own mechanism for catching and reporting
in the code that it is asked to evaluate. This mechanism summarizes the exceptions in the code that it is asked to evaluate. This mechanism
exception and gives the user a button they can click to see the full summarizes the exception and gives the user a button they can click to
stack, so the end result is very similar to what see the full stack, so the end result is very similar to what
@code{on-lazy-handler-dispatch} provides.) @code{on-lazy-handler-dispatch} provides. Deep inside
@code{gds-accept-input}, in the part that handles evaluating
expressions from Emacs, the GDS client code uses
@code{throw->trap-context} and @code{gds-debug-trap} to implement
this.
@node Working with GDS in Scheme Buffers @node Working with GDS in Scheme Buffers
@ -850,7 +851,7 @@ or before the cursor but can also be entered or edited in the
minibuffer. The available help is popped up in a temporary Emacs minibuffer. The available help is popped up in a temporary Emacs
window. window.
@item C-h C-g @item C-h G
@findex gds-apropos @findex gds-apropos
List all accessible Guile symbols matching a given regular expression, List all accessible Guile symbols matching a given regular expression,
with the same results as if you had typed @code{(apropos REGEXP)} into with the same results as if you had typed @code{(apropos REGEXP)} into
@ -987,6 +988,14 @@ region contains a balanced expression, or try to expand the region so
that it does; it uses the region exactly as it is. that it does; it uses the region exactly as it is.
@end table @end table
If you type @kbd{C-u} before one of these commands, GDS will
immediately pop up a Scheme stack buffer, showing the requested
evaluation, so that you can single step through it. (This is achieved
by setting a @code{<source-trap>} trap at the start of the requested
evaluation; see @ref{Source Traps} for more on how those work.) The
Scheme stack display, and the options for continuing through the code,
are described in the next two sections.
@node Displaying the Scheme Stack @node Displaying the Scheme Stack
@subsection Displaying the Scheme Stack @subsection Displaying the Scheme Stack
@ -1211,35 +1220,9 @@ display in action. To do this add
@noindent @noindent
to your @file{testgds.scm} buffer and type @kbd{C-x C-e} (which to your @file{testgds.scm} buffer and type @kbd{C-x C-e} (which
evaluates the expression that the cursor is just after the end of). The evaluates the expression that the cursor is just after the end of).
result is: The result should be that a GDS stack window like the following
appears:
@lisp
(fact1 4)
;;; Evaluating in current module (guile-user)
@result{} 24
--:** *Guile Evaluation* (Scheme:ready)--All------------
@end lisp
@noindent
which is correct, but indicates that we forgot the step needed to enable
the trap mechanism. To do this, type @kbd{C-c C-e} and then enter
@lisp
(trap-enable 'traps)
@end lisp
@noindent
into the minibuffer. (You could equally have typed this into your test
file and evaluated it from there; we use @kbd{C-c C-e} here to
demonstrate the minibuffer option and because you typically wouldn't
want to leave this kind of global setting in the source code that you
are working on.)
If you now type @kbd{C-x C-e} to evaluate @code{(fact1 4)} again, a GDS
stack window like the following appears:
@lisp @lisp
Calling procedure: Calling procedure:
@ -1250,19 +1233,10 @@ Calling procedure:
--:** PID 28729 (Guile-Debug)--All------------ --:** PID 28729 (Guile-Debug)--All------------
@end lisp @end lisp
GDS's most compelling feature is its single-stepping. To get an This stack tells you that Guile is about to call the @code{fact1}
immediate feel for what this is like, make sure your Emacs is prepared procedure, with argument 4, and you can step through this call in
as described in @ref{GDS Getting Started}, then type the following code detail by pressing @kbd{i} once and then @kbd{@key{SPC}}
into an interactive Guile session. (@pxref{Continuing Execution}).
@lisp
(fact1 4)
@end lisp
@noindent
This will cause the GDS Guile-Debug window to pop up in Emacs, where
you can then press @kbd{i} once and @kbd{@key{SPC}} repeatedly to
single-step through the code from the point of the initial trap.
(@kbd{i} is needed as the first keystroke rather than @kbd{@key{SPC}}, (@kbd{i} is needed as the first keystroke rather than @kbd{@key{SPC}},
because the aim here is to step through code in the @code{(ice-9 because the aim here is to step through code in the @code{(ice-9

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*- @c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual. @c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007 @c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions. @c See the file guile.texi for copying conditions.
@ -34,6 +34,7 @@ get the relevant SRFI documents from the SRFI home page
* SRFI-14:: Character-set library. * SRFI-14:: Character-set library.
* SRFI-16:: case-lambda * SRFI-16:: case-lambda
* SRFI-17:: Generalized set! * SRFI-17:: Generalized set!
* SRFI-18:: Multithreading support
* SRFI-19:: Time/Date library. * SRFI-19:: Time/Date library.
* SRFI-26:: Specializing parameters * SRFI-26:: Specializing parameters
* SRFI-31:: A special form `rec' for recursive evaluation * SRFI-31:: A special form `rec' for recursive evaluation
@ -44,6 +45,8 @@ get the relevant SRFI documents from the SRFI home page
* SRFI-55:: Requiring Features. * SRFI-55:: Requiring Features.
* SRFI-60:: Integers as bits. * SRFI-60:: Integers as bits.
* SRFI-61:: A more general `cond' clause * SRFI-61:: A more general `cond' clause
* SRFI-69:: Basic hash tables.
* SRFI-88:: Keyword objects.
@end menu @end menu
@ -1676,6 +1679,344 @@ The same as the Guile core @code{make-procedure-with-setter}
@end defun @end defun
@node SRFI-18
@subsection SRFI-18 - Multithreading support
@cindex SRFI-18
This is an implementation of the SRFI-18 threading and synchronization
library. The functions and variables described here are provided by
@example
(use-modules (srfi srfi-18))
@end example
As a general rule, the data types and functions in this SRFI-18
implementation are compatible with the types and functions in Guile's
core threading code. For example, mutexes created with the SRFI-18
@code{make-mutex} function can be passed to the built-in Guile
function @code{lock-mutex} (@pxref{Mutexes and Condition Variables}),
and mutexes created with the built-in Guile function @code{make-mutex}
can be passed to the SRFI-18 function @code{mutex-lock!}. Cases in
which this does not hold true are noted in the following sections.
@menu
* SRFI-18 Threads:: Executing code
* SRFI-18 Mutexes:: Mutual exclusion devices
* SRFI-18 Condition variables:: Synchronizing of groups of threads
* SRFI-18 Time:: Representation of times and durations
* SRFI-18 Exceptions:: Signalling and handling errors
@end menu
@node SRFI-18 Threads
@subsubsection SRFI-18 Threads
Threads created by SRFI-18 differ in two ways from threads created by
Guile's built-in thread functions. First, a thread created by SRFI-18
@code{make-thread} begins in a blocked state and will not start
execution until @code{thread-start!} is called on it. Second, SRFI-18
threads are constructed with a top-level exception handler that
captures any exceptions that are thrown on thread exit. In all other
regards, SRFI-18 threads are identical to normal Guile threads.
@defun current-thread
Returns the thread that called this function. This is the same
procedure as the same-named built-in procedure @code{current-thread}
(@pxref{Threads}).
@end defun
@defun thread? obj
Returns @code{#t} if @var{obj} is a thread, @code{#f} otherwise. This
is the same procedure as the same-named built-in procedure
@code{thread?} (@pxref{Threads}).
@end defun
@defun make-thread thunk [name]
Call @code{thunk} in a new thread and with a new dynamic state,
returning the new thread and optionally assigning it the object name
@var{name}, which may be any Scheme object.
Note that the name @code{make-thread} conflicts with the
@code{(ice-9 threads)} function @code{make-thread}. Applications
wanting to use both of these functions will need to refer to them by
different names.
@end defun
@defun thread-name thread
Returns the name assigned to @var{thread} at the time of its creation,
or @code{#f} if it was not given a name.
@end defun
@defun thread-specific thread
@defunx thread-specific-set! thread obj
Get or set the ``object-specific'' property of @var{thread}. In
Guile's implementation of SRFI-18, this value is stored as an object
property, and will be @code{#f} if not set.
@end defun
@defun thread-start! thread
Unblocks @var{thread} and allows it to begin execution if it has not
done so already.
@end defun
@defun thread-yield!
If one or more threads are waiting to execute, calling
@code{thread-yield!} forces an immediate context switch to one of them.
Otherwise, @code{thread-yield!} has no effect. @code{thread-yield!}
behaves identically to the Guile built-in function @code{yield}.
@end defun
@defun thread-sleep! timeout
The current thread waits until the point specified by the time object
@var{timeout} is reached (@pxref{SRFI-18 Time}). This blocks the
thread only if @var{timeout} represents a point in the future. it is
an error for @var{timeout} to be @code{#f}.
@end defun
@defun thread-terminate! thread
Causes an abnormal termination of @var{thread}. If @var{thread} is
not already terminated, all mutexes owned by @var{thread} become
unlocked/abandoned. If @var{thread} is the current thread,
@code{thread-terminate!} does not return. Otherwise
@code{thread-terminate!} returns an unspecified value; the termination
of @var{thread} will occur before @code{thread-terminate!} returns.
Subsequent attempts to join on @var{thread} will cause a ``terminated
thread exception'' to be raised.
@code{thread-terminate!} is compatible with the thread cancellation
procedures in the core threads API (@pxref{Threads}) in that if a
cleanup handler has been installed for the target thread, it will be
called before the thread exits and its return value (or exception, if
any) will be stored for later retrieval via a call to
@code{thread-join!}.
@end defun
@defun thread-join! thread [timeout [timeout-val]]
Wait for @var{thread} to terminate and return its exit value. When a
time value @var{timeout} is given, it specifies a point in time where
the waiting should be aborted. When the waiting is aborted,
@var{timeoutval} is returned if it is specified; otherwise, a
@code{join-timeout-exception} exception is raised
(@pxref{SRFI-18 Exceptions}). Exceptions may also be raised if the
thread was terminated by a call to @code{thread-terminate!}
(@code{terminated-thread-exception} will be raised) or if the thread
exited by raising an exception that was handled by the top-level
exception handler (@code{uncaught-exception} will be raised; the
original exception can be retrieved using
@code{uncaught-exception-reason}).
@end defun
@node SRFI-18 Mutexes
@subsubsection SRFI-18 Mutexes
The behavior of Guile's built-in mutexes is parameterized via a set of
flags passed to the @code{make-mutex} procedure in the core
(@pxref{Mutexes and Condition Variables}). To satisfy the requirements
for mutexes specified by SRFI-18, the @code{make-mutex} procedure
described below sets the following flags:
@itemize @bullet
@item
@code{recursive}: the mutex can be locked recursively
@item
@code{unchecked-unlock}: attempts to unlock a mutex that is already
unlocked will not raise an exception
@item
@code{allow-external-unlock}: the mutex can be unlocked by any thread,
not just the thread that locked it originally
@end itemize
@defun make-mutex [name]
Returns a new mutex, optionally assigning it the object name
@var{name}, which may be any Scheme object. The returned mutex will be
created with the configuration described above. Note that the name
@code{make-mutex} conflicts with Guile core function @code{make-mutex}.
Applications wanting to use both of these functions will need to refer
to them by different names.
@end defun
@defun mutex-name mutex
Returns the name assigned to @var{mutex} at the time of its creation,
or @code{#f} if it was not given a name.
@end defun
@defun mutex-specific mutex
@defunx mutex-specific-set! mutex obj
Get or set the ``object-specific'' property of @var{mutex}. In Guile's
implementation of SRFI-18, this value is stored as an object property,
and will be @code{#f} if not set.
@end defun
@defun mutex-state mutex
Returns information about the state of @var{mutex}. Possible values
are:
@itemize @bullet
@item
thread @code{T}: the mutex is in the locked/owned state and thread T
is the owner of the mutex
@item
symbol @code{not-owned}: the mutex is in the locked/not-owned state
@item
symbol @code{abandoned}: the mutex is in the unlocked/abandoned state
@item
symbol @code{not-abandoned}: the mutex is in the
unlocked/not-abandoned state
@end itemize
@end defun
@defun mutex-lock! mutex [timeout [thread]]
Lock @var{mutex}, optionally specifying a time object @var{timeout}
after which to abort the lock attempt and a thread @var{thread} giving
a new owner for @var{mutex} different than the current thread. This
procedure has the same behavior as the @code{lock-mutex} procedure in
the core library.
@end defun
@defun mutex-unlock! mutex [condition-variable [timeout]]
Unlock @var{mutex}, optionally specifying a condition variable
@var{condition-variable} on which to wait, either indefinitely or,
optionally, until the time object @var{timeout} has passed, to be
signalled. This procedure has the same behavior as the
@code{unlock-mutex} procedure in the core library.
@end defun
@node SRFI-18 Condition variables
@subsubsection SRFI-18 Condition variables
SRFI-18 does not specify a ``wait'' function for condition variables.
Waiting on a condition variable can be simulated using the SRFI-18
@code{mutex-unlock!} function described in the previous section, or
Guile's built-in @code{wait-condition-variable} procedure can be used.
@defun condition-variable? obj
Returns @code{#t} if @var{obj} is a condition variable, @code{#f}
otherwise. This is the same procedure as the same-named built-in
procedure
(@pxref{Mutexes and Condition Variables, @code{condition-variable?}}).
@end defun
@defun make-condition-variable [name]
Returns a new condition variable, optionally assigning it the object
name @var{name}, which may be any Scheme object. This procedure
replaces a procedure of the same name in the core library.
@end defun
@defun condition-variable-name condition-variable
Returns the name assigned to @var{thread} at the time of its creation,
or @code{#f} if it was not given a name.
@end defun
@defun condition-variable-specific condition-variable
@defunx condition-variable-specific-set! condition-variable obj
Get or set the ``object-specific'' property of
@var{condition-variable}. In Guile's implementation of SRFI-18, this
value is stored as an object property, and will be @code{#f} if not
set.
@end defun
@defun condition-variable-signal! condition-variable
@defunx condition-variable-broadcast! condition-variable
Wake up one thread that is waiting for @var{condition-variable}, in
the case of @code{condition-variable-signal!}, or all threads waiting
for it, in the case of @code{condition-variable-broadcast!}. The
behavior of these procedures is equivalent to that of the procedures
@code{signal-condition-variable} and
@code{broadcast-condition-variable} in the core library.
@end defun
@node SRFI-18 Time
@subsubsection SRFI-18 Time
The SRFI-18 time functions manipulate time in two formats: a
``time object'' type that represents an absolute point in time in some
implementation-specific way; and the number of seconds since some
unspecified ``epoch''. In Guile's implementation, the epoch is the
Unix epoch, 00:00:00 UTC, January 1, 1970.
@defun current-time
Return the current time as a time object. This procedure replaces
the procedure of the same name in the core library, which returns the
current time in seconds since the epoch.
@end defun
@defun time? obj
Returns @code{#t} if @var{obj} is a time object, @code{#f} otherwise.
@end defun
@defun time->seconds time
@defunx seconds->time seconds
Convert between time objects and numerical values representing the
number of seconds since the epoch. When converting from a time object
to seconds, the return value is the number of seconds between
@var{time} and the epoch. When converting from seconds to a time
object, the return value is a time object that represents a time
@var{seconds} seconds after the epoch.
@end defun
@node SRFI-18 Exceptions
@subsubsection SRFI-18 Exceptions
SRFI-18 exceptions are identical to the exceptions provided by
Guile's implementation of SRFI-34. The behavior of exception
handlers invoked to handle exceptions thrown from SRFI-18 functions,
however, differs from the conventional behavior of SRFI-34 in that
the continuation of the handler is the same as that of the call to
the function. Handlers are called in a tail-recursive manner; the
exceptions do not ``bubble up''.
@defun current-exception-handler
Returns the current exception handler.
@end defun
@defun with-exception-handler handler thunk
Installs @var{handler} as the current exception handler and calls the
procedure @var{thunk} with no arguments, returning its value as the
value of the exception. @var{handler} must be a procedure that accepts
a single argument. The current exception handler at the time this
procedure is called will be restored after the call returns.
@end defun
@defun raise obj
Raise @var{obj} as an exception. This is the same procedure as the
same-named procedure defined in SRFI 34.
@end defun
@defun join-timeout-exception? obj
Returns @code{#t} if @var{obj} is an exception raised as the result of
performing a timed join on a thread that does not exit within the
specified timeout, @code{#f} otherwise.
@end defun
@defun abandoned-mutex-exception? obj
Returns @code{#t} if @var{obj} is an exception raised as the result of
attempting to lock a mutex that has been abandoned by its owner thread,
@code{#f} otherwise.
@end defun
@defun terminated-thread-exception? obj
Returns @code{#t} if @var{obj} is an exception raised as the result of
joining on a thread that exited as the result of a call to
@code{thread-terminate!}.
@end defun
@defun uncaught-exception? obj
@defunx uncaught-exception-reason exc
@code{uncaught-exception?} returns @code{#t} if @var{obj} is an
exception thrown as the result of joining a thread that exited by
raising an exception that was handled by the top-level exception
handler installed by @code{make-thread}. When this occurs, the
original exception is preserved as part of the exception thrown by
@code{thread-join!} and can be accessed by calling
@code{uncaught-exception-reason} on that exception. Note that
because this exception-preservation mechanism is a side-effect of
@code{make-thread}, joining on threads that exited as described above
but were created by other means will not raise this
@code{uncaught-exception} error.
@end defun
@node SRFI-19 @node SRFI-19
@subsection SRFI-19 - Time/Date Library @subsection SRFI-19 - Time/Date Library
@cindex SRFI-19 @cindex SRFI-19
@ -1843,8 +2184,10 @@ Return the current time of the given @var{type}. The default
@var{type} is @code{time-utc}. @var{type} is @code{time-utc}.
Note that the name @code{current-time} conflicts with the Guile core Note that the name @code{current-time} conflicts with the Guile core
@code{current-time} function (@pxref{Time}). Applications wanting to @code{current-time} function (@pxref{Time}) as well as the SRFI-18
use both will need to use a different name for one of them. @code{current-time} function (@pxref{SRFI-18 Time}). Applications
wanting to use more than one of these functions will need to refer to
them by different names.
@end defun @end defun
@defun time-resolution [type] @defun time-resolution [type]
@ -2470,7 +2813,7 @@ specified by @var{field+value}, a sequence of field names (symbols) and
values as in the following example: values as in the following example:
@lisp @lisp
(let* ((&ct (make-condition-type 'foo &condition '(a b c)))) (let ((&ct (make-condition-type 'foo &condition '(a b c))))
(make-condition &ct 'a 1 'b 2 'c 3)) (make-condition &ct 'a 1 'b 2 'c 3))
@end lisp @end lisp
@ -3027,6 +3370,245 @@ needed to get SRFI-61 itself. Extended @code{cond} is documented in
@ref{if cond case,, Simple Conditional Evaluation}. @ref{if cond case,, Simple Conditional Evaluation}.
@node SRFI-69
@subsection SRFI-69 - Basic hash tables
@cindex SRFI-69
This is a portable wrapper around Guile's built-in hash table and weak
table support. @xref{Hash Tables}, for information on that built-in
support. Above that, this hash-table interface provides association
of equality and hash functions with tables at creation time, so
variants of each function are not required, as well as a procedure
that takes care of most uses for Guile hash table handles, which this
SRFI does not provide as such.
Access it with:
@lisp
(use-modules (srfi srfi-69))
@end lisp
@menu
* SRFI-69 Creating hash tables::
* SRFI-69 Accessing table items::
* SRFI-69 Table properties::
* SRFI-69 Hash table algorithms::
@end menu
@node SRFI-69 Creating hash tables
@subsubsection Creating hash tables
@deffn {Scheme Procedure} make-hash-table [equal-proc hash-proc #:weak weakness start-size]
Create and answer a new hash table with @var{equal-proc} as the
equality function and @var{hash-proc} as the hashing function.
By default, @var{equal-proc} is @code{equal?}. It can be any
two-argument procedure, and should answer whether two keys are the
same for this table's purposes.
My default @var{hash-proc} assumes that @code{equal-proc} is no
coarser than @code{equal?} unless it is literally @code{string-ci=?}.
If provided, @var{hash-proc} should be a two-argument procedure that
takes a key and the current table size, and answers a reasonably good
hash integer between 0 (inclusive) and the size (exclusive).
@var{weakness} should be @code{#f} or a symbol indicating how ``weak''
the hash table is:
@table @code
@item #f
An ordinary non-weak hash table. This is the default.
@item key
When the key has no more non-weak references at GC, remove that entry.
@item value
When the value has no more non-weak references at GC, remove that
entry.
@item key-or-value
When either has no more non-weak references at GC, remove the
association.
@end table
As a legacy of the time when Guile couldn't grow hash tables,
@var{start-size} is an optional integer argument that specifies the
approximate starting size for the hash table, which will be rounded to
an algorithmically-sounder number.
@end deffn
By @dfn{coarser} than @code{equal?}, we mean that for all @var{x} and
@var{y} values where @code{(@var{equal-proc} @var{x} @var{y})},
@code{(equal? @var{x} @var{y})} as well. If that does not hold for
your @var{equal-proc}, you must provide a @var{hash-proc}.
In the case of weak tables, remember that @dfn{references} above
always refers to @code{eq?}-wise references. Just because you have a
reference to some string @code{"foo"} doesn't mean that an association
with key @code{"foo"} in a weak-key table @emph{won't} be collected;
it only counts as a reference if the two @code{"foo"}s are @code{eq?},
regardless of @var{equal-proc}. As such, it is usually only sensible
to use @code{eq?} and @code{hashq} as the equivalence and hash
functions for a weak table. @xref{Weak References}, for more
information on Guile's built-in weak table support.
@deffn {Scheme Procedure} alist->hash-table alist [equal-proc hash-proc #:weak weakness start-size]
As with @code{make-hash-table}, but initialize it with the
associations in @var{alist}. Where keys are repeated in @var{alist},
the leftmost association takes precedence.
@end deffn
@node SRFI-69 Accessing table items
@subsubsection Accessing table items
@deffn {Scheme Procedure} hash-table-ref table key [default-thunk]
@deffnx {Scheme Procedure} hash-table-ref/default table key default
Answer the value associated with @var{key} in @var{table}. If
@var{key} is not present, answer the result of invoking the thunk
@var{default-thunk}, which signals an error instead by default.
@code{hash-table-ref/default} is a variant that requires a third
argument, @var{default}, and answers @var{default} itself instead of
invoking it.
@end deffn
@deffn {Scheme Procedure} hash-table-set! table key new-value
Set @var{key} to @var{new-value} in @var{table}.
@end deffn
@deffn {Scheme Procedure} hash-table-delete! table key
Remove the association of @var{key} in @var{table}, if present. If
absent, do nothing.
@end deffn
@deffn {Scheme Procedure} hash-table-exists? table key
Answer whether @var{key} has an association in @var{table}.
@end deffn
@deffn {Scheme Procedure} hash-table-update! table key modifier [default-thunk]
@deffnx {Scheme Procedure} hash-table-update!/default table key modifier default
Replace @var{key}'s associated value in @var{table} by invoking
@var{modifier} with one argument, the old value.
If @var{key} is not present, and @var{default-thunk} is provided,
invoke it with no arguments to get the ``old value'' to be passed to
@var{modifier} as above. If @var{default-thunk} is not provided in
such a case, signal an error.
@code{hash-table-update!/default} is a variant that requires the
fourth argument, which is used directly as the ``old value'' rather
than as a thunk to be invoked to retrieve the ``old value''.
@end deffn
@node SRFI-69 Table properties
@subsubsection Table properties
@deffn {Scheme Procedure} hash-table-size table
Answer the number of associations in @var{table}. This is guaranteed
to run in constant time for non-weak tables.
@end deffn
@deffn {Scheme Procedure} hash-table-keys table
Answer an unordered list of the keys in @var{table}.
@end deffn
@deffn {Scheme Procedure} hash-table-values table
Answer an unordered list of the values in @var{table}.
@end deffn
@deffn {Scheme Procedure} hash-table-walk table proc
Invoke @var{proc} once for each association in @var{table}, passing
the key and value as arguments.
@end deffn
@deffn {Scheme Procedure} hash-table-fold table proc init
Invoke @code{(@var{proc} @var{key} @var{value} @var{previous})} for
each @var{key} and @var{value} in @var{table}, where @var{previous} is
the result of the previous invocation, using @var{init} as the first
@var{previous} value. Answer the final @var{proc} result.
@end deffn
@deffn {Scheme Procedure} hash-table->alist table
Answer an alist where each association in @var{table} is an
association in the result.
@end deffn
@node SRFI-69 Hash table algorithms
@subsubsection Hash table algorithms
Each hash table carries an @dfn{equivalence function} and a @dfn{hash
function}, used to implement key lookups. Beginning users should
follow the rules for consistency of the default @var{hash-proc}
specified above. Advanced users can use these to implement their own
equivalence and hash functions for specialized lookup semantics.
@deffn {Scheme Procedure} hash-table-equivalence-function hash-table
@deffnx {Scheme Procedure} hash-table-hash-function hash-table
Answer the equivalence and hash function of @var{hash-table}, respectively.
@end deffn
@deffn {Scheme Procedure} hash obj [size]
@deffnx {Scheme Procedure} string-hash obj [size]
@deffnx {Scheme Procedure} string-ci-hash obj [size]
@deffnx {Scheme Procedure} hash-by-identity obj [size]
Answer a hash value appropriate for equality predicate @code{equal?},
@code{string=?}, @code{string-ci=?}, and @code{eq?}, respectively.
@end deffn
@code{hash} is a backwards-compatible replacement for Guile's built-in
@code{hash}.
@node SRFI-88
@subsection SRFI-88 Keyword Objects
@cindex SRFI-88
@cindex keyword objects
@uref{http://srfi.schemers.org/srfi-88/srfi-88.html, SRFI-88} provides
@dfn{keyword objects}, which are equivalent to Guile's keywords
(@pxref{Keywords}). SRFI-88 keywords can be entered using the
@dfn{postfix keyword syntax}, which consists of an identifier followed
by @code{:} (@pxref{Reader options, @code{postfix} keyword syntax}).
SRFI-88 can be made available with:
@example
(use-modules (srfi srfi-88))
@end example
Doing so installs the right reader option for keyword syntax, using
@code{(read-set! keywords 'postfix)}. It also provides the procedures
described below.
@deffn {Scheme Procedure} keyword? obj
Return @code{#t} if @var{obj} is a keyword. This is the same procedure
as the same-named built-in procedure (@pxref{Keyword Procedures,
@code{keyword?}}).
@example
(keyword? foo:) @result{} #t
(keyword? 'foo:) @result{} #t
(keyword? "foo") @result{} #f
@end example
@end deffn
@deffn {Scheme Procedure} keyword->string kw
Return the name of @var{kw} as a string, i.e., without the trailing
colon. The returned string may not be modified, e.g., with
@code{string-set!}.
@example
(keyword->string foo:) @result{} "foo"
@end example
@end deffn
@deffn {Scheme Procedure} string->keyword str
Return the keyword object whose name is @var{str}.
@example
(keyword->string (string->keyword "a b c")) @result{} "a b c"
@end example
@end deffn
@c srfi-modules.texi ends here @c srfi-modules.texi ends here
@c Local Variables: @c Local Variables:

View file

@ -1,3 +1,9 @@
2008-07-17 Neil Jerram <neil@ossau.uklinux.net>
* gds-scheme.el (gds-eval-region, gds-eval-expression)
(gds-eval-defun, gds-eval-last-sexp): Support `C-u' prefix,
meaning that user wants to single step through the code.
2007-02-06 Clinton Ebadi <clinton@unknownlamer.org> 2007-02-06 Clinton Ebadi <clinton@unknownlamer.org>
* gds-scheme.el (gds-display-results): Use save-selected-window * gds-scheme.el (gds-display-results): Use save-selected-window

View file

@ -279,9 +279,12 @@ region's code."
(setq line (count-lines (point-min) (point)))) (setq line (count-lines (point-min) (point))))
(cons line column))) (cons line column)))
(defun gds-eval-region (start end) (defun gds-eval-region (start end &optional debugp)
"Evaluate the current region." "Evaluate the current region. If invoked with `C-u' prefix (or, in
(interactive "r") a program, with optional DEBUGP arg non-nil), pause and pop up the
stack at the start of the evaluation, so that the user can single-step
through the code."
(interactive "r\nP")
(or gds-client (or gds-client
(gds-auto-associate-buffer) (gds-auto-associate-buffer)
(call-interactively 'gds-associate-buffer)) (call-interactively 'gds-associate-buffer))
@ -289,24 +292,29 @@ region's code."
(port-name (gds-port-name start end)) (port-name (gds-port-name start end))
(lc (gds-line-and-column start))) (lc (gds-line-and-column start)))
(let ((code (buffer-substring-no-properties start end))) (let ((code (buffer-substring-no-properties start end)))
(gds-send (format "eval (region . %S) %s %S %d %d %S" (gds-send (format "eval (region . %S) %s %S %d %d %S %s"
(gds-abbreviated code) (gds-abbreviated code)
(if module (prin1-to-string module) "#f") (if module (prin1-to-string module) "#f")
port-name (car lc) (cdr lc) port-name (car lc) (cdr lc)
code) code
(if debugp '(debug) '(none)))
gds-client)))) gds-client))))
(defun gds-eval-expression (expr &optional correlator) (defun gds-eval-expression (expr &optional correlator debugp)
"Evaluate the supplied EXPR (a string)." "Evaluate the supplied EXPR (a string). If invoked with `C-u'
(interactive "sEvaluate expression: \nP") prefix (or, in a program, with optional DEBUGP arg non-nil), pause and
pop up the stack at the start of the evaluation, so that the user can
single-step through the code."
(interactive "sEvaluate expression: \ni\nP")
(or gds-client (or gds-client
(gds-auto-associate-buffer) (gds-auto-associate-buffer)
(call-interactively 'gds-associate-buffer)) (call-interactively 'gds-associate-buffer))
(set-text-properties 0 (length expr) nil expr) (set-text-properties 0 (length expr) nil expr)
(gds-send (format "eval (%S . %S) #f \"Emacs expression\" 0 0 %S" (gds-send (format "eval (%S . %S) #f \"Emacs expression\" 0 0 %S %s"
(or correlator 'expression) (or correlator 'expression)
(gds-abbreviated expr) (gds-abbreviated expr)
expr) expr
(if debugp '(debug) '(none)))
gds-client)) gds-client))
(defconst gds-abbreviated-length 35) (defconst gds-abbreviated-length 35)
@ -325,19 +333,25 @@ region's code."
(concat (substring code 0 (- gds-abbreviated-length 3)) "...") (concat (substring code 0 (- gds-abbreviated-length 3)) "...")
code)) code))
(defun gds-eval-defun () (defun gds-eval-defun (&optional debugp)
"Evaluate the defun (top-level form) at point." "Evaluate the defun (top-level form) at point. If invoked with
(interactive) `C-u' prefix (or, in a program, with optional DEBUGP arg non-nil),
pause and pop up the stack at the start of the evaluation, so that the
user can single-step through the code."
(interactive "P")
(save-excursion (save-excursion
(end-of-defun) (end-of-defun)
(let ((end (point))) (let ((end (point)))
(beginning-of-defun) (beginning-of-defun)
(gds-eval-region (point) end)))) (gds-eval-region (point) end debugp))))
(defun gds-eval-last-sexp () (defun gds-eval-last-sexp (&optional debugp)
"Evaluate the sexp before point." "Evaluate the sexp before point. If invoked with `C-u' prefix (or,
(interactive) in a program, with optional DEBUGP arg non-nil), pause and pop up the
(gds-eval-region (save-excursion (backward-sexp) (point)) (point))) stack at the start of the evaluation, so that the user can single-step
through the code."
(interactive "P")
(gds-eval-region (save-excursion (backward-sexp) (point)) (point) debugp))
;;;; Help. ;;;; Help.

View file

@ -1,3 +1,7 @@
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* compat/compat.h: Update copyright statement to LGPL.
2002-11-17 Mikael Djurfeldt <mdj@linnaeus> 2002-11-17 Mikael Djurfeldt <mdj@linnaeus>
* README: Added description of compat. * README: Added description of compat.

View file

@ -2,46 +2,22 @@
#ifndef COMPATH #ifndef COMPATH
#define COMPATH #define COMPATH
/* Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. /* Copyright (C) 2001, 2002, 2006, 2008 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU Lesser General Public
* the Free Software Foundation; either version 2, or (at your option) * License as published by the Free Software Foundation; either
* any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU Lesser General Public
* along with this software; see the file COPYING. If not, write to * License along with this library; if not, write to the Free Software
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Boston, MA 02110-1301 USA */
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
*
* The exception is that, if you link the GUILE library with other files
* to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the GUILE library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the
* Free Software Foundation under the name GUILE. If you copy
* code from other Free Software Foundation releases into a copy of
* GUILE, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
#ifndef SCM_GC8MARKP #ifndef SCM_GC8MARKP

15
guile-1.8.pc.in Normal file
View file

@ -0,0 +1,15 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
sitedir=@sitedir@
libguileinterface=@LIBGUILE_INTERFACE@
Name: GNU Guile
Description: GNU's Ubiquitous Intelligent Language for Extension
Version: @GUILE_VERSION@
Libs: -L${libdir} -lguile @GUILE_LIBS@
Cflags: -I${includedir} @GUILE_CFLAGS@

View file

View file

@ -1,3 +1,16 @@
2008-06-02 Ludovic Courtès <ludo@gnu.org>
* guile-config.in (build-link): Show `-L' before `-lguile'.
Reported by Peter O'Gorman <pogma@thewrittenword.com>.
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* COPYING: Removed.
2007-12-30 Mike Gran <spk121@yahoo.com>
* guile.m4: add serial number to m4
2007-01-04 Kevin Ryde <user42@zip.com.au> 2007-01-04 Kevin Ryde <user42@zip.com.au>
* Makefile.am (guile-config): Use "|" as the sed delimiter, for the * Makefile.am (guile-config): Use "|" as the sed delimiter, for the

View file

@ -4,7 +4,7 @@
;;;; guile-config --- utility for linking programs with Guile ;;;; guile-config --- utility for linking programs with Guile
;;;; Jim Blandy <jim@red-bean.com> --- September 1997 ;;;; Jim Blandy <jim@red-bean.com> --- September 1997
;;;; ;;;;
;;;; Copyright (C) 1998, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. ;;;; Copyright (C) 1998, 2001, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
;;;; ;;;;
;;;; This library is free software; you can redistribute it and/or ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; modify it under the terms of the GNU Lesser General Public
@ -151,11 +151,11 @@
(display (string-join (display (string-join
(list (list
(get-build-info 'CFLAGS) (get-build-info 'CFLAGS)
"-lguile -lltdl"
(if (or (string=? libdir "/usr/lib") (if (or (string=? libdir "/usr/lib")
(string=? libdir "/usr/lib/")) (string=? libdir "/usr/lib/"))
"" ""
(string-append "-L" (get-build-info 'libdir))) (string-append "-L" (get-build-info 'libdir)))
"-lguile -lltdl"
(string-join other-flags) (string-join other-flags)
))) )))

View file

@ -16,6 +16,8 @@
## License along with this library; if not, write to the Free Software ## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# serial 9
## Index ## Index
## ----- ## -----
## ##

View file

@ -1,165 +0,0 @@
dnl Autoconf macros for configuring the QuickThreads package
dnl Jim Blandy <jimb@red-bean.com> --- July 1998
dnl
dnl Copyright (C) 1998, 1999, 2006 Free Software Foundation, Inc.
dnl
dnl This file is part of GUILE.
dnl
dnl GUILE is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as
dnl published by the Free Software Foundation; either version 2, or
dnl (at your option) any later version.
dnl
dnl GUILE is distributed in the hope that it will be useful, but
dnl 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
dnl You should have received a copy of the GNU General Public
dnl License along with GUILE; see the file COPYING. If not, write
dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
dnl Floor, Boston, MA 02110-1301 USA
dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT
dnl sources should be in $srcdir/qt. If configuration succeeds, this
dnl macro creates the appropriate symlinks in the qt object directory,
dnl and sets the following variables, used in building libqthreads.a:
dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration
dnl succeeds, or the empty string if configuration fails.
dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine-
dnl dependent source files.
dnl qthread_asflags --- flags to pass to the compiler when processing
dnl assembly-language files.
dnl
dnl It also sets the following variables, which describe how clients
dnl can link against libqthreads.a:
dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or
dnl the empty string if configuration fails.
dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree
dnl THREAD_LIBS_INSTALLED --- linker options for use after this package
dnl is installed
dnl It would be nice if all thread configuration packages for Guile
dnl followed the same conventions.
dnl
dnl All of the above variables will be substituted into Makefiles in
dnl the usual autoconf fashion.
dnl
dnl We distinguish between THREAD_LIBS_LOCAL and
dnl THREAD_LIBS_INSTALLED because the thread library might be in
dnl this tree, and be built using libtool. This means that:
dnl 1) when building other executables in this tree, one must
dnl pass the relative path to the ../libfoo.la file, but
dnl 2) once the whole package has been installed, users should
dnl link using -lfoo.
dnl Normally, we only care about the first case, but since the
dnl guile-config script needs to give users all the flags they need
dnl to link programs against guile, the GUILE_WITH_THREADS macro
dnl needs to supply the second piece of information as well.
dnl
dnl This whole thing is a little confused about what ought to be
dnl done in the top-level configure script, and what ought to be
dnl taken care of in the subdirectory. For example, qtmds_s and
dnl friends really ought not to be even mentioned in the top-level
dnl configure script, but here they are.
AC_DEFUN([QTHREADS_CONFIGURE],[
AC_REQUIRE([AC_PROG_LN_S])
AC_MSG_CHECKING(QuickThreads configuration)
changequote(,)dnl We use [ and ] in a regexp in the case
THREAD_PACKAGE=QT
qthread_asflags=''
case "$host" in
i[3456]86-*-*)
port_name=i386
qtmd_h=md/i386.h
qtmds_s=md/i386.s
qtmdc_c=md/null.c
qtdmdb_s=
case "$host" in
*-*-netbsd* )
## NetBSD needs to be told to pass the assembly code through
## the C preprocessor. Other GCC installations seem to do
## this by default, but NetBSD's doesn't. We could get the
## same effect by giving the file a name ending with .S
## instead of .s, but I don't see how to tell automake to do
## that.
qthread_asflags='-x assembler-with-cpp'
;;
esac
;;
mips-sgi-irix[56]*)
port_name=irix
qtmd_h=md/mips.h
qtmds_s=md/mips-irix5.s
qtmdc_c=md/null.c
qtdmdb_s=md/mips_b.s
;;
mips-*-*)
port_name=mips
qtmd_h=md/mips.h
qtmds_s=md/mips.s
qtmdc_c=md/null.c
qtdmdb_s=md/mips_b.s
;;
sparc-*-sunos*)
port_name=sparc-sunos
qtmd_h=md/sparc.h
qtmds_s=md/_sparc.s
qtmdc_c=md/null.c
qtdmdb_s=md/_sparc_b.s
;;
sparc*-*-*)
port_name=sparc
qtmd_h=md/sparc.h
qtmds_s=md/sparc.s
qtmdc_c=md/null.c
qtdmdb_s=md/sparc_b.s
;;
alpha*-*-*)
port_name=alpha
qtmd_h=md/axp.h
qtmds_s=md/axp.s
qtmdc_c=md/null.c
qtdmdb_s=md/axp_b.s
;;
arm*-*-*)
port_name=arm
qtmd_h=md/arm.h
qtmds_s=md/arm.s
qtmdc_c=md/null.c
qtdmdb_s=
;;
*)
echo "Unknown configuration; threads package disabled"
THREAD_PACKAGE=""
;;
esac
changequote([, ])
# Did configuration succeed?
if test -n "$THREAD_PACKAGE"; then
AC_MSG_RESULT($port_name)
QTHREAD_LTLIBS=libqthreads.la
THREAD_LIBS_LOCAL="../qt/libqthreads.la"
THREAD_LIBS_INSTALLED="-lqthreads"
else
AC_MSG_RESULT(none; disabled)
fi
AC_SUBST(QTHREAD_LTLIBS)
AC_SUBST(qtmd_h)
AC_SUBST(qtmds_s)
AC_SUBST(qtmdc_c)
AC_SUBST(qtdmdb_s)
AC_SUBST(qthread_asflags)
AC_SUBST(THREAD_PACKAGE)
AC_SUBST(THREAD_LIBS_LOCAL)
AC_SUBST(THREAD_LIBS_INSTALLED)
])
dnl qthreads.m4 ends here

View file

@ -1,3 +1,28 @@
2008-05-07 Ludovic Courtès <ludo@gnu.org>
* ice-9/Makefile.am (guile_pdd): Don't use `patsubst': it's GNU
Make and broke BSD Make as found on FreeBSD 6.2.
2008-04-16 Ludovic Courtès <ludo@gnu.org>
* configure.in (AC_INIT): Don't use "echo -n", which is not
available on MacOS X; use `patsubst' instead to remove the
newline. Reported by Steven Wu <wus@qwest.net>.
2008-02-16 Ludovic Courtès <ludo@gnu.org>
* LIBGUILEREADLINE-VERSION
(LIBGUILEREADLINE_INTERFACE_REVISION): Increment for release.
2008-01-29 Neil Jerram <neil@ossau.uklinux.net>
* readline.c (scm_init_readline): Only do init_bouncing_parens ()
if HAVE_RL_GET_KEYMAP.
(init_bouncing_parens, find_matching_paren, match_paren): Compile
out if ! HAVE_RL_GET_KEYMAP.
* configure.in: Add check for rl_get_keymap.
2007-07-29 Ludovic Courtès <ludo@gnu.org> 2007-07-29 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (INCLUDES): Add Gnulib includes. * Makefile.am (INCLUDES): Add Gnulib includes.

View file

@ -1,7 +1,12 @@
AC_PREREQ(2.50) AC_PREREQ(2.50)
dnl Don't use "echo -n", which is not portable (e.g., not available on
dnl MacOS X). Instead, use `patsubst' to remove the newline.
AC_INIT(guile-readline, AC_INIT(guile-readline,
m4_esyscmd(. ../GUILE-VERSION && echo -n ${GUILE_VERSION})) patsubst(m4_esyscmd(. ../GUILE-VERSION && echo ${GUILE_VERSION}), [
]),
[bug-guile@gnu.org])
AC_CONFIG_AUX_DIR([.]) AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR(readline.c) AC_CONFIG_SRCDIR(readline.c)
AM_CONFIG_HEADER([guile-readline-config.h]) AM_CONFIG_HEADER([guile-readline-config.h])
@ -43,6 +48,11 @@ AC_CHECK_FUNCS(siginterrupt rl_clear_signals rl_cleanup_after_signal)
dnl Check for modern readline naming dnl Check for modern readline naming
AC_CHECK_FUNCS(rl_filename_completion_function) AC_CHECK_FUNCS(rl_filename_completion_function)
dnl Check for rl_get_keymap. We only use this for deciding whether to
dnl install paren matching on the Guile command line (when using
dnl readline for input), so it's completely optional.
AC_CHECK_FUNCS(rl_get_keymap)
dnl Check for rl_pre_input_hook. This is more complicated because on dnl Check for rl_pre_input_hook. This is more complicated because on
dnl some systems (HP/UX), the linker wont let us treat dnl some systems (HP/UX), the linker wont let us treat
dnl rl_pre_input_hook as a function when it really is a function dnl rl_pre_input_hook as a function when it really is a function

View file

@ -1,7 +1,6 @@
## Process this file with Automake to create Makefile.in ## Process this file with Automake to create Makefile.in
## ##
## Copyright (C) 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc. ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
## Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
## ##
## This file is part of GUILE. ## This file is part of GUILE.
## ##
@ -20,7 +19,9 @@
## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth ## to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
## Floor, Boston, MA 02110-1301 USA ## Floor, Boston, MA 02110-1301 USA
guile_pdd = $(patsubst %/guile-readline,%/guile,$(pkgdatadir)) # Guile's `pkgdatadir'.
guile_pdd = $(datadir)/guile
ice9dir = $(guile_pdd)/$(GUILE_EFFECTIVE_VERSION)/ice-9 ice9dir = $(guile_pdd)/$(GUILE_EFFECTIVE_VERSION)/ice-9
ice9_DATA = readline.scm ice9_DATA = readline.scm
ETAGS_ARGS = $(ice9_DATA) ETAGS_ARGS = $(ice9_DATA)

View file

@ -1,6 +1,6 @@
/* readline.c --- line editing support for Guile */ /* readline.c --- line editing support for Guile */
/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. /* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -425,6 +425,7 @@ completion_function (char *text, int continuep)
} }
} }
#if HAVE_RL_GET_KEYMAP
/*Bouncing parenthesis (reimplemented by GH, 11/23/98, since readline is strict gpl)*/ /*Bouncing parenthesis (reimplemented by GH, 11/23/98, since readline is strict gpl)*/
static int match_paren (int x, int k); static int match_paren (int x, int k);
@ -528,6 +529,7 @@ match_paren (int x, int k)
} }
return 0; return 0;
} }
#endif /* HAVE_RL_GET_KEYMAP */
#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED) #if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
/* Readline disables SA_RESTART on SIGWINCH. /* Readline disables SA_RESTART on SIGWINCH.
@ -575,7 +577,9 @@ scm_init_readline ()
reentry_barrier_mutex = scm_permanent_object (scm_make_mutex ()); reentry_barrier_mutex = scm_permanent_object (scm_make_mutex ());
scm_init_opts (scm_readline_options, scm_init_opts (scm_readline_options,
scm_readline_opts); scm_readline_opts);
#if HAVE_RL_GET_KEYMAP
init_bouncing_parens(); init_bouncing_parens();
#endif
scm_add_feature ("readline"); scm_add_feature ("readline");
#endif /* HAVE_RL_GETC_FUNCTION */ #endif /* HAVE_RL_GETC_FUNCTION */
} }

View file

View file

@ -1,3 +1,28 @@
2008-07-17 Neil Jerram <neil@ossau.uklinux.net>
* gds-client.scm (handle-nondebug-protocol): Add support for
setting a trap on code that is about to be evaluated.
2008-04-14 Neil Jerram <neil@ossau.uklinux.net>
* gds-client.scm (gds-debug-trap): Ensure that frame index passed
to Emacs is always positive.
2008-03-19 Neil Jerram <neil@ossau.uklinux.net>
* debugging/ice-9-debugger-extensions.scm (command-loop): Use
needed modules.
2008-02-22 Ludovic Courtès <ludo@gnu.org>
* match.scm: Export `match:andmap'. This fixes evaluation of
expressions like `(match expr (((_ ...) ...) #t))' where a list
of lists is to be matched.
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* COPYING: Removed.
2007-10-02 Ludovic Courtès <ludo@gnu.org> 2007-10-02 Ludovic Courtès <ludo@gnu.org>
* slib.scm: Let SLIB's `guile.init' do most of the job. See the * slib.scm: Let SLIB's `guile.init' do most of the job. See the

View file

@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
## ##
## Copyright (C) 1998,1999,2000,2001,2003, 2004, 2006 Free Software Foundation, Inc. ## Copyright (C) 1998,1999,2000,2001,2003, 2004, 2006, 2008 Free Software Foundation, Inc.
## ##
## This file is part of GUILE. ## This file is part of GUILE.
## ##
@ -46,7 +46,6 @@ TAGS_FILES = $(subpkgdata_DATA)
## test.scm is not currently installed. ## test.scm is not currently installed.
EXTRA_DIST = $(ice9_sources) test.scm compile-psyntax.scm EXTRA_DIST = $(ice9_sources) test.scm compile-psyntax.scm
if MAINTAINER_MODE
# We expect this to never be invoked when there is not already # We expect this to never be invoked when there is not already
# ice-9/psyntax.pp in %load-path, since compile-psyntax.scm depends # ice-9/psyntax.pp in %load-path, since compile-psyntax.scm depends
# on ice-9/syncase.scm, which does `(load-from-path "ice-9/psyntax.pp")'. # on ice-9/syncase.scm, which does `(load-from-path "ice-9/psyntax.pp")'.
@ -56,4 +55,4 @@ include $(top_srcdir)/am/pre-inst-guile
psyntax.pp: psyntax.ss psyntax.pp: psyntax.ss
$(preinstguile) -s $(srcdir)/compile-psyntax.scm \ $(preinstguile) -s $(srcdir)/compile-psyntax.scm \
$(srcdir)/psyntax.ss $(srcdir)/psyntax.pp $(srcdir)/psyntax.ss $(srcdir)/psyntax.pp
endif

View file

@ -28,7 +28,10 @@
(cond ((string>=? (version) "1.7") (cond ((string>=? (version) "1.7")
(use-modules (ice-9 debugger command-loop)) (use-modules (ice-9 debugger command-loop))
(define-module (ice-9 debugger command-loop)) (define-module (ice-9 debugger command-loop)
#:use-module (ice-9 debugger)
#:use-module (ice-9 debugger state)
#:use-module (ice-9 debugging traps))
(define new-define-command define-command) (define new-define-command define-command)
(set! define-command (set! define-command
(lambda (name argument-template documentation procedure) (lambda (name argument-template documentation procedure)

View file

@ -73,7 +73,9 @@
(slot-ref (car fired-traps) 'depth))))) (slot-ref (car fired-traps) 'depth)))))
;; Write current stack to the frontend. ;; Write current stack to the frontend.
(write-form (list 'stack (write-form (list 'stack
(or special-index 0) (if (and special-index (> special-index 0))
special-index
0)
(stack->emacs-readable stack) (stack->emacs-readable stack)
(append (flags->emacs-readable flags) (append (flags->emacs-readable flags)
(slot-ref trap-context (slot-ref trap-context
@ -352,7 +354,7 @@ Thanks!\n\n"
((eval) ((eval)
(set! last-lazy-trap-context #f) (set! last-lazy-trap-context #f)
(apply (lambda (correlator module port-name line column code) (apply (lambda (correlator module port-name line column code flags)
(with-input-from-string code (with-input-from-string code
(lambda () (lambda ()
(set-port-filename! (current-input-port) port-name) (set-port-filename! (current-input-port) port-name)
@ -382,6 +384,11 @@ Thanks!\n\n"
;; it to the list. ;; it to the list.
(begin (begin
(for-each-breakpoint setup-after-read x) (for-each-breakpoint setup-after-read x)
(if (and (pair? x)
(memq 'debug flags))
(install-trap (make <source-trap>
#:expression x
#:behaviour gds-debug-trap)))
(loop (cons x exprs) (read)))))) (loop (cons x exprs) (read))))))
(lambda (key . args) (lambda (key . args)
(write-form `(eval-results (write-form `(eval-results

View file

@ -1,6 +1,6 @@
;;; installed-scm-file ;;; installed-scm-file
;;;; Copyright (C) 2001, 2006 Free Software Foundation, Inc. ;;;; Copyright (C) 2001, 2006, 2008 Free Software Foundation, Inc.
;;;; ;;;;
;;;; This library is free software; you can redistribute it and/or ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; modify it under the terms of the GNU Lesser General Public
@ -22,6 +22,7 @@
:export (match match-lambda match-lambda* match-define :export (match match-lambda match-lambda* match-define
match-let match-let* match-letrec match-let match-let* match-letrec
define-structure define-const-structure define-structure define-const-structure
match:andmap
match:error match:set-error match:error match:set-error
match:error-control match:set-error-control match:error-control match:set-error-control
match:structure-control match:set-structure-control match:structure-control match:set-structure-control

View file

@ -1,3 +1,12 @@
2008-04-14 Neil Jerram <neil@ossau.uklinux.net>
* primitives/symprop.scm (get): Use lambda->nil.
* primitives/strings.scm (aset): New primitive.
* internals/load.scm (load): Use in-vicinity (instead of
string-append) to add a slash if needed.
2004-02-08 Mikael Djurfeldt <djurfeldt@nada.kth.se> 2004-02-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* primitives/Makefile.am (TAGS_FILES), internals/Makefile.am * primitives/Makefile.am (TAGS_FILES), internals/Makefile.am

View file

@ -15,9 +15,8 @@
'("") '("")
load-path))) load-path)))
(cond ((null? dirs) #f) (cond ((null? dirs) #f)
((file-exists? (string-append (car dirs) ((file-exists? (in-vicinity (car dirs) filename))
filename)) (in-vicinity (car dirs) filename))
(string-append (car dirs) filename))
(else (loop (cdr dirs))))))) (else (loop (cdr dirs)))))))
(if pathname (if pathname
(begin (begin

View file

@ -29,6 +29,12 @@
((string? array) (char->integer (string-ref array idx))) ((string? array) (char->integer (string-ref array idx)))
(else (wta 'arrayp array 1))))) (else (wta 'arrayp array 1)))))
(fset 'aset
(lambda (array idx newelt)
(cond ((vector? array) (vector-set! array idx newelt))
((string? array) (string-set! array idx (integer->char newelt)))
(else (wta 'arrayp array 1)))))
(fset 'stringp (lambda->nil string?)) (fset 'stringp (lambda->nil string?))
(fset 'vector vector) (fset 'vector vector)

View file

@ -9,7 +9,7 @@
(fset 'put set-symbol-property!) (fset 'put set-symbol-property!)
(fset 'get symbol-property) (fset 'get (lambda->nil symbol-property))
(fset 'set set) (fset 'set set)

222
lib/Makefile.am Normal file
View file

@ -0,0 +1,222 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2002-2008 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
# Public License, this file may be distributed as part of a program
# that contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl alloca count-one-bits extensions strcase strftime
AUTOMAKE_OPTIONS = 1.5 gnits
noinst_HEADERS =
noinst_LIBRARIES =
noinst_LTLIBRARIES =
EXTRA_DIST =
BUILT_SOURCES =
SUFFIXES =
MOSTLYCLEANFILES = core *.stackdump
MOSTLYCLEANDIRS =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
AM_CPPFLAGS =
noinst_LTLIBRARIES += libgnu.la
libgnu_la_SOURCES =
libgnu_la_LIBADD = $(gl_LTLIBOBJS)
libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
EXTRA_libgnu_la_SOURCES =
libgnu_la_LDFLAGS = $(AM_LDFLAGS)
## begin gnulib module alloca
EXTRA_DIST += alloca.c
EXTRA_libgnu_la_SOURCES += alloca.c
libgnu_la_LIBADD += @LTALLOCA@
libgnu_la_DEPENDENCIES += @LTALLOCA@
## end gnulib module alloca
## begin gnulib module alloca-opt
BUILT_SOURCES += $(ALLOCA_H)
# We need the following in order to create <alloca.h> when the system
# doesn't have one that works with the given compiler.
alloca.h: alloca.in.h
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
cat $(srcdir)/alloca.in.h; \
} > $@-t
mv -f $@-t $@
MOSTLYCLEANFILES += alloca.h alloca.h-t
EXTRA_DIST += alloca.in.h
## end gnulib module alloca-opt
## begin gnulib module count-one-bits
EXTRA_DIST += count-one-bits.h
## end gnulib module count-one-bits
## begin gnulib module link-warning
LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
## end gnulib module link-warning
## begin gnulib module stdbool
BUILT_SOURCES += $(STDBOOL_H)
# We need the following in order to create <stdbool.h> when the system
# doesn't have one that works.
stdbool.h: stdbool.in.h
rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
} > $@-t
mv $@-t $@
MOSTLYCLEANFILES += stdbool.h stdbool.h-t
EXTRA_DIST += stdbool.in.h
## end gnulib module stdbool
## begin gnulib module strcase
EXTRA_DIST += strcasecmp.c strncasecmp.c
EXTRA_libgnu_la_SOURCES += strcasecmp.c strncasecmp.c
## end gnulib module strcase
## begin gnulib module strftime
EXTRA_DIST += strftime.c strftime.h
EXTRA_libgnu_la_SOURCES += strftime.c
## end gnulib module strftime
## begin gnulib module strings
BUILT_SOURCES += strings.h
# We need the following in order to create <strings.h> when the system
# doesn't have one that works with the given compiler.
strings.h: strings.in.h
rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
-e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
-e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/strings.in.h; \
} > $@-t
mv $@-t $@
MOSTLYCLEANFILES += strings.h strings.h-t
EXTRA_DIST += strings.in.h
## end gnulib module strings
## begin gnulib module time
BUILT_SOURCES += time.h
# We need the following in order to create <time.h> when the system
# doesn't have one that works with the given compiler.
time.h: time.in.h
rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \
-e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
< $(srcdir)/time.in.h; \
} > $@-t
mv $@-t $@
MOSTLYCLEANFILES += time.h time.h-t
EXTRA_DIST += time.in.h
## end gnulib module time
## begin gnulib module time_r
EXTRA_DIST += time_r.c
EXTRA_libgnu_la_SOURCES += time_r.c
## end gnulib module time_r
## begin gnulib module verify
libgnu_la_SOURCES += verify.h
## end gnulib module verify
## begin gnulib module wchar
BUILT_SOURCES += $(WCHAR_H)
# We need the following in order to create <wchar.h> when the system
# version does not work standalone.
wchar.h: wchar.in.h
rm -f $@-t $@
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
-e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
-e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
} > $@-t
mv $@-t $@
MOSTLYCLEANFILES += wchar.h wchar.h-t
EXTRA_DIST += wchar.in.h
## end gnulib module wchar
## begin gnulib module dummy
libgnu_la_SOURCES += dummy.c
## end gnulib module dummy
mostlyclean-local: mostlyclean-generic
@for dir in '' $(MOSTLYCLEANDIRS); do \
if test -n "$$dir" && test -d $$dir; then \
echo "rmdir $$dir"; rmdir $$dir; \
fi; \
done; \
:

489
lib/alloca.c Normal file
View file

@ -0,0 +1,489 @@
/* alloca.c -- allocate automatically reclaimed memory
(Mostly) portable public-domain implementation -- D A Gwyn
This implementation of the PWB library alloca function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
J.Otto Tennant <jot@cray.com> contributed the Cray support.
There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */
#include <config.h>
#include <alloca.h>
#include <string.h>
#include <stdlib.h>
#ifdef emacs
# include "lisp.h"
# include "blockinput.h"
# ifdef EMACS_FREE
# undef free
# define free EMACS_FREE
# endif
#else
# define memory_full() abort ()
#endif
/* If compiling with GCC 2, this file's not needed. */
#if !defined (__GNUC__) || __GNUC__ < 2
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
# ifndef alloca
# ifdef emacs
# ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
# ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
/* Using #error here is not wise since this file should work for
old and obscure compilers. */
# endif /* STACK_DIRECTION undefined */
# endif /* static */
# endif /* emacs */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
# else
# define ADDRESS_FUNCTION(arg) &(arg)
# endif
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
# ifndef STACK_DIRECTION
# define STACK_DIRECTION 0 /* Direction unknown. */
# endif
# if STACK_DIRECTION != 0
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
# else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known. */
# define STACK_DIR stack_dir
static void
find_stack_direction (void)
{
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
if (addr == NULL)
{ /* Initial entry. */
addr = ADDRESS_FUNCTION (dummy);
find_stack_direction (); /* Recurse once. */
}
else
{
/* Second entry. */
if (ADDRESS_FUNCTION (dummy) > addr)
stack_dir = 1; /* Stack grew upward. */
else
stack_dir = -1; /* Stack grew downward. */
}
}
# endif /* STACK_DIRECTION == 0 */
/* An "alloca header" is used to:
(a) chain together all alloca'ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
# ifndef ALIGN_SIZE
# define ALIGN_SIZE sizeof(double)
# endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* To force sizeof(header). */
struct
{
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
} h;
} header;
static header *last_alloca_header = NULL; /* -> last alloca header. */
/* Return a pointer to at least SIZE bytes of storage,
which will be automatically reclaimed upon exit from
the procedure that called alloca. Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
void *
alloca (size_t size)
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
# if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
find_stack_direction ();
# endif
/* Reclaim garbage, defined as all alloca'd storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* Traverses linked list. */
# ifdef emacs
BLOCK_INPUT;
# endif
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free (hp); /* Collect garbage. */
hp = np; /* -> next header. */
}
else
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage. */
# ifdef emacs
UNBLOCK_INPUT;
# endif
}
if (size == 0)
return NULL; /* No allocation required. */
/* Allocate combined header + user data storage. */
{
/* Address of header. */
register header *new;
size_t combined_size = sizeof (header) + size;
if (combined_size < sizeof (header))
memory_full ();
new = malloc (combined_size);
if (! new)
memory_full ();
new->h.next = last_alloca_header;
new->h.deep = depth;
last_alloca_header = new;
/* User storage begins just after header. */
return (void *) (new + 1);
}
}
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
# ifdef DEBUG_I00AFUNC
# include <stdio.h>
# endif
# ifndef CRAY_STACK
# define CRAY_STACK
# ifndef CRAY2
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
struct stack_control_header
{
long shgrow:32; /* Number of times stack has grown. */
long shaseg:32; /* Size of increments to stack. */
long shhwm:32; /* High water mark of stack. */
long shsize:32; /* Current size of stack (all segments). */
};
/* The stack segment linkage control information occurs at
the high-address end of a stack segment. (The stack
grows from low addresses to high addresses.) The initial
part of the stack segment linkage control information is
0200 (octal) words. This provides for register storage
for the routine which overflows the stack. */
struct stack_segment_linkage
{
long ss[0200]; /* 0200 overflow words. */
long sssize:32; /* Number of words in this segment. */
long ssbase:32; /* Offset to stack base. */
long:32;
long sspseg:32; /* Offset to linkage control of previous
segment of stack. */
long:32;
long sstcpt:32; /* Pointer to task common address block. */
long sscsnm; /* Private control structure number for
microtasking. */
long ssusr1; /* Reserved for user. */
long ssusr2; /* Reserved for user. */
long sstpid; /* Process ID for pid based multi-tasking. */
long ssgvup; /* Pointer to multitasking thread giveup. */
long sscray[7]; /* Reserved for Cray Research. */
long ssa0;
long ssa1;
long ssa2;
long ssa3;
long ssa4;
long ssa5;
long ssa6;
long ssa7;
long sss0;
long sss1;
long sss2;
long sss3;
long sss4;
long sss5;
long sss6;
long sss7;
};
# else /* CRAY2 */
/* The following structure defines the vector of words
returned by the STKSTAT library routine. */
struct stk_stat
{
long now; /* Current total stack size. */
long maxc; /* Amount of contiguous space which would
be required to satisfy the maximum
stack demand to date. */
long high_water; /* Stack high-water mark. */
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
long hits; /* Number of internal buffer hits. */
long extends; /* Number of block extensions. */
long stko_mallocs; /* Block allocations by $STKOFEN. */
long underflows; /* Number of stack underflow calls ($STKRETN). */
long stko_free; /* Number of deallocations by $STKRETN. */
long stkm_free; /* Number of deallocations by $STKMRET. */
long segments; /* Current number of stack segments. */
long maxs; /* Maximum number of stack segments so far. */
long pad_size; /* Stack pad size. */
long current_address; /* Current stack segment address. */
long current_size; /* Current stack segment size. This
number is actually corrupted by STKSTAT to
include the fifteen word trailer area. */
long initial_address; /* Address of initial segment. */
long initial_size; /* Size of initial segment. */
};
/* The following structure describes the data structure which trails
any stack segment. I think that the description in 'asdef' is
out of date. I only describe the parts that I am sure about. */
struct stk_trailer
{
long this_address; /* Address of this block. */
long this_size; /* Size of this block (does not include
this trailer). */
long unknown2;
long unknown3;
long link; /* Address of trailer block of previous
segment. */
long unknown5;
long unknown6;
long unknown7;
long unknown8;
long unknown9;
long unknown10;
long unknown11;
long unknown12;
long unknown13;
long unknown14;
};
# endif /* CRAY2 */
# endif /* not CRAY_STACK */
# ifdef CRAY2
/* Determine a "stack measure" for an arbitrary ADDRESS.
I doubt that "lint" will like this much. */
static long
i00afunc (long *address)
{
struct stk_stat status;
struct stk_trailer *trailer;
long *block, size;
long result = 0;
/* We want to iterate through all of the segments. The first
step is to get the stack status structure. We could do this
more quickly and more directly, perhaps, by referencing the
$LM00 common block, but I know that this works. */
STKSTAT (&status);
/* Set up the iteration. */
trailer = (struct stk_trailer *) (status.current_address
+ status.current_size
- 15);
/* There must be at least one stack segment. Therefore it is
a fatal error if "trailer" is null. */
if (trailer == 0)
abort ();
/* Discard segments that do not contain our argument address. */
while (trailer != 0)
{
block = (long *) trailer->this_address;
size = trailer->this_size;
if (block == 0 || size == 0)
abort ();
trailer = (struct stk_trailer *) trailer->link;
if ((block <= address) && (address < (block + size)))
break;
}
/* Set the result to the offset in this segment and add the sizes
of all predecessor segments. */
result = address - block;
if (trailer == 0)
{
return result;
}
do
{
if (trailer->this_size <= 0)
abort ();
result += trailer->this_size;
trailer = (struct stk_trailer *) trailer->link;
}
while (trailer != 0);
/* We are done. Note that if you present a bogus address (one
not in any segment), you will get a different number back, formed
from subtracting the address of the first block. This is probably
not what you want. */
return (result);
}
# else /* not CRAY2 */
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
Determine the number of the cell within the stack,
given the address of the cell. The purpose of this
routine is to linearize, in some sense, stack addresses
for alloca. */
static long
i00afunc (long address)
{
long stkl = 0;
long size, pseg, this_segment, stack;
long result = 0;
struct stack_segment_linkage *ssptr;
/* Register B67 contains the address of the end of the
current stack segment. If you (as a subprogram) store
your registers on the stack and find that you are past
the contents of B67, you have overflowed the segment.
B67 also points to the stack segment linkage control
area, which is what we are really interested in. */
stkl = CRAY_STACKSEG_END ();
ssptr = (struct stack_segment_linkage *) stkl;
/* If one subtracts 'size' from the end of the segment,
one has the address of the first word of the segment.
If this is not the first segment, 'pseg' will be
nonzero. */
pseg = ssptr->sspseg;
size = ssptr->sssize;
this_segment = stkl - size;
/* It is possible that calling this routine itself caused
a stack overflow. Discard stack segments which do not
contain the target address. */
while (!(this_segment <= address && address <= stkl))
{
# ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
# endif
if (pseg == 0)
break;
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
this_segment = stkl - size;
}
result = address - this_segment;
/* If you subtract pseg from the current end of the stack,
you get the address of the previous stack segment's end.
This seems a little convoluted to me, but I'll bet you save
a cycle somewhere. */
while (pseg != 0)
{
# ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o\n", pseg, size);
# endif
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
result += size;
}
return (result);
}
# endif /* not CRAY2 */
# endif /* CRAY */
# endif /* no alloca */
#endif /* not GCC version 2 */

56
lib/alloca.in.h Normal file
View file

@ -0,0 +1,56 @@
/* Memory allocation on the stack.
Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
Foundation, Inc.
This program 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, 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 Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
means there is a real alloca function. */
#ifndef _GL_ALLOCA_H
#define _GL_ALLOCA_H
/* alloca (N) returns a pointer to N bytes of memory
allocated on the stack, which will last until the function returns.
Use of alloca should be avoided:
- inside arguments of function calls - undefined behaviour,
- in inline functions - the allocation may actually last until the
calling function returns,
- for huge N (say, N >= 65536) - you never know how large (or small)
the stack is, and when the stack cannot fulfill the memory allocation
request, the program just crashes.
*/
#ifndef alloca
# ifdef __GNUC__
# define alloca __builtin_alloca
# elif defined _AIX
# define alloca __alloca
# elif defined _MSC_VER
# include <malloc.h>
# define alloca _alloca
# elif defined __DECC && defined __VMS
# define alloca __ALLOCA
# else
# include <stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
# endif
#endif
#endif /* _GL_ALLOCA_H */

77
lib/count-one-bits.h Normal file
View file

@ -0,0 +1,77 @@
/* count-one-bits.h -- counts the number of 1-bits in a word.
Copyright (C) 2007-2008 Free Software Foundation, Inc.
This program 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU 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, see <http://www.gnu.org/licenses/>. */
/* Written by Ben Pfaff. */
#ifndef COUNT_ONE_BITS_H
# define COUNT_ONE_BITS_H 1
#include <stdlib.h>
#include "verify.h"
/* Expand the code which computes the number of 1-bits of the local
variable 'x' of type TYPE (an unsigned integer type) and returns it
from the current function. */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#define COUNT_ONE_BITS(BUILTIN, TYPE) \
return BUILTIN (x);
#else
#define COUNT_ONE_BITS(BUILTIN, TYPE) \
/* This condition is written so as to avoid shifting by more than \
31 bits at once, and also avoids a random HP-UX cc bug. */ \
verify (((TYPE) -1 >> 31 >> 31 >> 2) == 0); /* TYPE has at most 64 bits */ \
int count = count_one_bits_32 (x); \
if (1 < (TYPE) -1 >> 31) /* TYPE has more than 32 bits? */ \
count += count_one_bits_32 (x >> 31 >> 1); \
return count;
/* Compute and return the the number of 1-bits set in the least
significant 32 bits of X. */
static inline int
count_one_bits_32 (unsigned int x)
{
x = ((x & 0xaaaaaaaaU) >> 1) + (x & 0x55555555U);
x = ((x & 0xccccccccU) >> 2) + (x & 0x33333333U);
x = (x >> 16) + (x & 0xffff);
x = ((x & 0xf0f0) >> 4) + (x & 0x0f0f);
return (x >> 8) + (x & 0x00ff);
}
#endif
/* Compute and return the number of 1-bits set in X. */
static inline int
count_one_bits (unsigned int x)
{
COUNT_ONE_BITS (__builtin_popcount, unsigned int);
}
/* Compute and return the number of 1-bits set in X. */
static inline int
count_one_bits_l (unsigned long int x)
{
COUNT_ONE_BITS (__builtin_popcountl, unsigned long int);
}
#if HAVE_UNSIGNED_LONG_LONG_INT
/* Compute and return the number of 1-bits set in X. */
static inline int
count_one_bits_ll (unsigned long long int x)
{
COUNT_ONE_BITS (__builtin_popcountll, unsigned long long int);
}
#endif
#endif /* COUNT_ONE_BITS_H */

42
lib/dummy.c Normal file
View file

@ -0,0 +1,42 @@
/* A dummy file, to prevent empty libraries from breaking builds.
Copyright (C) 2004, 2007 Free Software Foundation, Inc.
This program 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU 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, see <http://www.gnu.org/licenses/>. */
/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
libraries without any object files. You might get an error like:
> ar cru .libs/libgl.a
> ar: no archive members specified
Compiling this file, and adding its object file to the library, will
prevent the library from being empty. */
/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
that don't export any symbol. You might get an error like:
> cc ... libgnu.a
> ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a
Compiling this file, and adding its object file to the library, will
prevent the library from exporting no symbols. */
#ifdef __sun
/* This declaration ensures that the library will export at least 1 symbol. */
int gl_dummy_symbol;
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
#endif

119
lib/stdbool.in.h Normal file
View file

@ -0,0 +1,119 @@
/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GL_STDBOOL_H
#define _GL_STDBOOL_H
/* ISO C 99 <stdbool.h> for platforms that lack it. */
/* Usage suggestions:
Programs that use <stdbool.h> should be aware of some limitations
and standards compliance issues.
Standards compliance:
- <stdbool.h> must be #included before 'bool', 'false', 'true'
can be used.
- You cannot assume that sizeof (bool) == 1.
- Programs should not undefine the macros bool, true, and false,
as C99 lists that as an "obsolescent feature".
Limitations of this substitute, when used in a C89 environment:
- <stdbool.h> must be #included before the '_Bool' type can be used.
- You cannot assume that _Bool is a typedef; it might be a macro.
- Bit-fields of type 'bool' are not supported. Portable code
should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
- In C99, casts and automatic conversions to '_Bool' or 'bool' are
performed in such a way that every nonzero value gets converted
to 'true', and zero gets converted to 'false'. This doesn't work
with this substitute. With this substitute, only the values 0 and 1
give the expected result when converted to _Bool' or 'bool'.
Also, it is suggested that programs use 'bool' rather than '_Bool';
this isn't required, but 'bool' is more common. */
/* 7.16. Boolean type and values */
/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
definitions below, but temporarily we have to #undef them. */
#if defined __BEOS__ && !defined __HAIKU__
# include <OS.h> /* defines bool but not _Bool */
# undef false
# undef true
#endif
/* For the sake of symbolic names in gdb, we define true and false as
enum constants, not only as macros.
It is tempting to write
typedef enum { false = 0, true = 1 } _Bool;
so that gdb prints values of type 'bool' symbolically. But if we do
this, values of type '_Bool' may promote to 'int' or 'unsigned int'
(see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
(see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
enum; this ensures that '_Bool' promotes to 'int'. */
#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
/* A compiler known to have 'bool'. */
/* If the compiler already has both 'bool' and '_Bool', we can assume they
are the same types. */
# if !@HAVE__BOOL@
typedef bool _Bool;
# endif
#else
# if !defined __GNUC__
/* If @HAVE__BOOL@:
Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
the built-in _Bool type is used. See
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
Similar bugs are likely with other compilers as well; this file
wouldn't be used if <stdbool.h> was working.
So we override the _Bool type.
If !@HAVE__BOOL@:
Need to define _Bool ourselves. As 'signed char' or as an enum type?
Use of a typedef, with SunPRO C, leads to a stupid
"warning: _Bool is a keyword in ISO C99".
Use of an enum type, with IRIX cc, leads to a stupid
"warning(1185): enumerated type mixed with another type".
Even the existence of an enum type, without a typedef,
"Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
The only benefit of the enum, debuggability, is not important
with these compilers. So use 'signed char' and no enum. */
# define _Bool signed char
# else
/* With this compiler, trust the _Bool type if the compiler has it. */
# if !@HAVE__BOOL@
typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
# endif
# endif
#endif
#define bool _Bool
/* The other macros must be usable in preprocessor directives. */
#define false 0
#define true 1
#define __bool_true_false_are_defined 1
#endif /* _GL_STDBOOL_H */

63
lib/strcasecmp.c Normal file
View file

@ -0,0 +1,63 @@
/* Case-insensitive string comparison function.
Copyright (C) 1998-1999, 2005-2007 Free Software Foundation, Inc.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <config.h>
/* Specification. */
#include <string.h>
#include <ctype.h>
#include <limits.h>
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less than, equal to or greater
than S2.
Note: This function does not work with multibyte strings! */
int
strcasecmp (const char *s1, const char *s2)
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
if (p1 == p2)
return 0;
do
{
c1 = TOLOWER (*p1);
c2 = TOLOWER (*p2);
if (c1 == '\0')
break;
++p1;
++p2;
}
while (c1 == c2);
if (UCHAR_MAX <= INT_MAX)
return c1 - c2;
else
/* On machines where 'char' and 'int' are types of the same size, the
difference of two 'unsigned char' values - including the sign bit -
doesn't fit in an 'int'. */
return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
}

1461
lib/strftime.c Normal file

File diff suppressed because it is too large Load diff

26
lib/strftime.h Normal file
View file

@ -0,0 +1,26 @@
/* declarations for strftime.c
Copyright (C) 2002, 2004, 2008 Free Software Foundation, Inc.
This program 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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU 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, see <http://www.gnu.org/licenses/>. */
#include <time.h>
/* Just like strftime, but with two more arguments:
POSIX requires that strftime use the local timezone information.
When __UTC is nonzero and tm->tm_zone is NULL or the empty string,
use UTC instead. Use __NS as the number of nanoseconds in the
%N directive. */
size_t nstrftime (char *, size_t, char const *, struct tm const *,
int __utc, int __ns);

88
lib/strings.in.h Normal file
View file

@ -0,0 +1,88 @@
/* A substitute <strings.h>.
Copyright (C) 2007-2008 Free Software Foundation, Inc.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GL_STRINGS_H
@PRAGMA_SYSTEM_HEADER@
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STRINGS_H@
#ifndef _GL_STRINGS_H
#define _GL_STRINGS_H
/* The definition of GL_LINK_WARNING is copied here. */
#ifdef __cplusplus
extern "C" {
#endif
/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
greater than zero if S1 is lexicographically less than, equal to or greater
than S2.
Note: This function does not work in multibyte locales. */
#if ! @HAVE_STRCASECMP@
extern int strcasecmp (char const *s1, char const *s2);
#endif
#if defined GNULIB_POSIXCHECK
/* strcasecmp() does not work with multibyte strings:
POSIX says that it operates on "strings", and "string" in POSIX is defined
as a sequence of bytes, not of characters. */
# undef strcasecmp
# define strcasecmp(a,b) \
(GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \
"in multibyte locales - " \
"use mbscasecmp if you care about " \
"internationalization, or use c_strcasecmp (from " \
"gnulib module c-strcase) if you want a locale " \
"independent function"), \
strcasecmp (a, b))
#endif
/* Compare no more than N bytes of strings S1 and S2, ignoring case,
returning less than, equal to or greater than zero if S1 is
lexicographically less than, equal to or greater than S2.
Note: This function cannot work correctly in multibyte locales. */
#if ! @HAVE_DECL_STRNCASECMP@
extern int strncasecmp (char const *s1, char const *s2, size_t n);
#endif
#if defined GNULIB_POSIXCHECK
/* strncasecmp() does not work with multibyte strings:
POSIX says that it operates on "strings", and "string" in POSIX is defined
as a sequence of bytes, not of characters. */
# undef strncasecmp
# define strncasecmp(a,b,n) \
(GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \
"strings in multibyte locales - " \
"use mbsncasecmp or mbspcasecmp if you care about " \
"internationalization, or use c_strncasecmp (from " \
"gnulib module c-strcase) if you want a locale " \
"independent function"), \
strncasecmp (a, b, n))
#endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_STRING_H */
#endif /* _GL_STRING_H */

63
lib/strncasecmp.c Normal file
View file

@ -0,0 +1,63 @@
/* strncasecmp.c -- case insensitive string comparator
Copyright (C) 1998-1999, 2005-2007 Free Software Foundation, Inc.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <config.h>
/* Specification. */
#include <string.h>
#include <ctype.h>
#include <limits.h>
#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
/* Compare no more than N bytes of strings S1 and S2, ignoring case,
returning less than, equal to or greater than zero if S1 is
lexicographically less than, equal to or greater than S2.
Note: This function cannot work correctly in multibyte locales. */
int
strncasecmp (const char *s1, const char *s2, size_t n)
{
register const unsigned char *p1 = (const unsigned char *) s1;
register const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
if (p1 == p2 || n == 0)
return 0;
do
{
c1 = TOLOWER (*p1);
c2 = TOLOWER (*p2);
if (--n == 0 || c1 == '\0')
break;
++p1;
++p2;
}
while (c1 == c2);
if (UCHAR_MAX <= INT_MAX)
return c1 - c2;
else
/* On machines where 'char' and 'int' are types of the same size, the
difference of two 'unsigned char' values - including the sign bit -
doesn't fit in an 'int'. */
return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
}

116
lib/time.in.h Normal file
View file

@ -0,0 +1,116 @@
/* A more-standard <time.h>.
Copyright (C) 2007-2008 Free Software Foundation, Inc.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
@PRAGMA_SYSTEM_HEADER@
/* Don't get in the way of glibc when it includes time.h merely to
declare a few standard symbols, rather than to declare all the
symbols. Also, Solaris 8 <time.h> eventually includes itself
recursively; if that is happening, just include the system <time.h>
without adding our own declarations. */
#if (defined __need_time_t || defined __need_clock_t \
|| defined __need_timespec \
|| defined _GL_TIME_H)
# @INCLUDE_NEXT@ @NEXT_TIME_H@
#else
# define _GL_TIME_H
# @INCLUDE_NEXT@ @NEXT_TIME_H@
# ifdef __cplusplus
extern "C" {
# endif
/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
Or they define it with the wrong member names or define it in <sys/time.h>
(e.g., FreeBSD circa 1997). */
# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
# include <sys/time.h>
# else
# undef timespec
# define timespec rpl_timespec
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
# endif
# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
<http://www.opengroup.org/susv3xsh/nanosleep.html>. */
# if @REPLACE_NANOSLEEP@
# define nanosleep rpl_nanosleep
int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp);
# endif
/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
<http://www.opengroup.org/susv3xsh/localtime_r.html> and
<http://www.opengroup.org/susv3xsh/gmtime_r.html>. */
# if @REPLACE_LOCALTIME_R@
# undef localtime_r
# define localtime_r rpl_localtime_r
# undef gmtime_r
# define gmtime_r rpl_gmtime_r
struct tm *localtime_r (time_t const *restrict __timer,
struct tm *restrict __result);
struct tm *gmtime_r (time_t const *restrict __timer,
struct tm *restrict __result);
# endif
/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
the resulting broken-down time into TM. See
<http://www.opengroup.org/susv3xsh/strptime.html>. */
# if @REPLACE_STRPTIME@
# undef strptime
# define strptime rpl_strptime
char *strptime (char const *restrict __buf, char const *restrict __format,
struct tm *restrict __tm);
# endif
/* Convert TM to a time_t value, assuming UTC. */
# if @REPLACE_TIMEGM@
# undef timegm
# define timegm rpl_timegm
time_t timegm (struct tm *__tm);
# endif
/* Encourage applications to avoid unsafe functions that can overrun
buffers when given outlandish struct tm values. Portable
applications should use strftime (or even sprintf) instead. */
# if GNULIB_PORTCHECK
# undef asctime
# define asctime eschew_asctime
# undef asctime_r
# define asctime_r eschew_asctime_r
# undef ctime
# define ctime eschew_ctime
# undef ctime_r
# define ctime_r eschew_ctime_r
# endif
# ifdef __cplusplus
}
# endif
#endif

47
lib/time_r.c Normal file
View file

@ -0,0 +1,47 @@
/* Reentrant time functions like localtime_r.
Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert. */
#include <config.h>
#include <time.h>
#include <string.h>
static struct tm *
copy_tm_result (struct tm *dest, struct tm const *src)
{
if (! src)
return 0;
*dest = *src;
return dest;
}
struct tm *
gmtime_r (time_t const * restrict t, struct tm * restrict tp)
{
return copy_tm_result (tp, gmtime (t));
}
struct tm *
localtime_r (time_t const * restrict t, struct tm * restrict tp)
{
return copy_tm_result (tp, localtime (t));
}

140
lib/verify.h Normal file
View file

@ -0,0 +1,140 @@
/* Compile-time assert-like macros.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU 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, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
#ifndef VERIFY_H
# define VERIFY_H 1
/* Each of these macros verifies that its argument R is nonzero. To
be portable, R should be an integer constant expression. Unlike
assert (R), there is no run-time overhead.
There are two macros, since no single macro can be used in all
contexts in C. verify_true (R) is for scalar contexts, including
integer constant expression contexts. verify (R) is for declaration
contexts, e.g., the top level.
Symbols ending in "__" are private to this header.
The code below uses several ideas.
* The first step is ((R) ? 1 : -1). Given an expression R, of
integral or boolean or floating-point type, this yields an
expression of integral type, whose value is later verified to be
constant and nonnegative.
* Next this expression W is wrapped in a type
struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
If W is negative, this yields a compile-time error. No compiler can
deal with a bit-field of negative size.
One might think that an array size check would have the same
effect, that is, that the type struct { unsigned int dummy[W]; }
would work as well. However, inside a function, some compilers
(such as C++ compilers and GNU C) allow local parameters and
variables inside array size expressions. With these compilers,
an array size check would not properly diagnose this misuse of
the verify macro:
void function (int n) { verify (n < 0); }
* For the verify macro, the struct verify_type__ will need to
somehow be embedded into a declaration. To be portable, this
declaration must declare an object, a constant, a function, or a
typedef name. If the declared entity uses the type directly,
such as in
struct dummy {...};
typedef struct {...} dummy;
extern struct {...} *dummy;
extern void dummy (struct {...} *);
extern struct {...} *dummy (void);
two uses of the verify macro would yield colliding declarations
if the entity names are not disambiguated. A workaround is to
attach the current line number to the entity name:
#define GL_CONCAT0(x, y) x##y
#define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
extern struct {...} * GL_CONCAT(dummy,__LINE__);
But this has the problem that two invocations of verify from
within the same macro would collide, since the __LINE__ value
would be the same for both invocations.
A solution is to use the sizeof operator. It yields a number,
getting rid of the identity of the type. Declarations like
extern int dummy [sizeof (struct {...})];
extern void dummy (int [sizeof (struct {...})]);
extern int (*dummy (void)) [sizeof (struct {...})];
can be repeated.
* Should the implementation use a named struct or an unnamed struct?
Which of the following alternatives can be used?
extern int dummy [sizeof (struct {...})];
extern int dummy [sizeof (struct verify_type__ {...})];
extern void dummy (int [sizeof (struct {...})]);
extern void dummy (int [sizeof (struct verify_type__ {...})]);
extern int (*dummy (void)) [sizeof (struct {...})];
extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
In the second and sixth case, the struct type is exported to the
outer scope; two such declarations therefore collide. GCC warns
about the first, third, and fourth cases. So the only remaining
possibility is the fifth case:
extern int (*dummy (void)) [sizeof (struct {...})];
* This implementation exploits the fact that GCC does not warn about
the last declaration mentioned above. If a future version of GCC
introduces a warning for this, the problem could be worked around
by using code specialized to GCC, e.g.,:
#if 4 <= __GNUC__
# define verify(R) \
extern int (* verify_function__ (void)) \
[__builtin_constant_p (R) && (R) ? 1 : -1]
#endif
* In C++, any struct definition inside sizeof is invalid.
Use a template type to work around the problem. */
/* Verify requirement R at compile-time, as an integer constant expression.
Return 1. */
# ifdef __cplusplus
template <int w>
struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
# define verify_true(R) \
(!!sizeof (verify_type__<(R) ? 1 : -1>))
# else
# define verify_true(R) \
(!!sizeof \
(struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
# endif
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. */
# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
#endif

93
lib/wchar.in.h Normal file
View file

@ -0,0 +1,93 @@
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
Copyright (C) 2007-2008 Free Software Foundation, Inc.
This program 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, 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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Eric Blake. */
/*
* ISO C 99 <wchar.h> for platforms that have issues.
* <http://www.opengroup.org/susv3xbd/wchar.h.html>
*
* For now, this just ensures proper prerequisite inclusion order and
* the declaration of wcwidth().
*/
@PRAGMA_SYSTEM_HEADER@
#ifdef __need_mbstate_t
/* Special invocation convention inside uClibc header files. */
#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
#else
/* Normal invocation convention. */
#ifndef _GL_WCHAR_H
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
included before <wchar.h>. */
#include <stddef.h>
#include <stdio.h>
#include <time.h>
/* Include the original <wchar.h> if it exists.
Some builds of uClibc lack it. */
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_WCHAR_H@
# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
#endif
#ifndef _GL_WCHAR_H
#define _GL_WCHAR_H
/* The definition of GL_LINK_WARNING is copied here. */
#ifdef __cplusplus
extern "C" {
#endif
/* Return the number of screen columns needed for WC. */
#if @GNULIB_WCWIDTH@
# if @REPLACE_WCWIDTH@
# undef wcwidth
# define wcwidth rpl_wcwidth
extern int wcwidth (wchar_t);
# else
# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
/* wcwidth exists but is not declared. */
extern int wcwidth (int /* actually wchar_t */);
# endif
# endif
#elif defined GNULIB_POSIXCHECK
# undef wcwidth
# define wcwidth(w) \
(GL_LINK_WARNING ("wcwidth is unportable - " \
"use gnulib module wcwidth for portability"), \
wcwidth (w))
#endif
#ifdef __cplusplus
}
#endif
#endif /* _GL_WCHAR_H */
#endif /* _GL_WCHAR_H */
#endif

View file

@ -1,46 +1,22 @@
#ifndef SCM_LIBGUILE_H #ifndef SCM_LIBGUILE_H
#define SCM_LIBGUILE_H #define SCM_LIBGUILE_H
/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU Lesser General Public
* the Free Software Foundation; either version 2, or (at your option) * License as published by the Free Software Foundation; either
* any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU Lesser General Public
* along with this software; see the file COPYING. If not, write to * License along with this library; if not, write to the Free Software
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Boston, MA 02110-1301 USA */
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
*
* The exception is that, if you link the GUILE library with other files
* to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the GUILE library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the
* Free Software Foundation under the name GUILE. If you copy
* code from other Free Software Foundation releases into a copy of
* GUILE, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
/* This needs to be included outside of the extern "C" block. /* This needs to be included outside of the extern "C" block.

15
libguile/.gitignore vendored Normal file
View file

@ -0,0 +1,15 @@
c-tokenize.c
cpp_err_symbols.c
cpp_sig_symbols.c
gen-scmconfig
gen-scmconfig.h
guile
guile-doc-snarf
guile-func-name-check
guile-procedures.texi
guile-snarf
guile-snarf-docs
guile_filter_doc_snarfage
libpath.h
scmconfig.h
version.h

View file

View file

@ -1,3 +1,445 @@
2008-08-29 Julian Graham <joolean@gmail.com>
* threads.c (fat_mutex_lock): Resolve a deadlock caused by not
checking mutex state after calling `SCM_TICK'.
2008-08-27 Ludovic Courtès <ludo@gnu.org>
Fix builds `--without-threads'. Reported by Han-Wen Nienhuys
<hanwen@xs4all.nl>.
* scmsigs.c (scm_i_close_signal_pipe): Don't refer to
`signal_pipe' unless `SCM_USE_PTHREAD_THREADS' is true.
* threads.c (scm_leave_guile_cleanup): Mark as `SCM_UNUSED'.
2008-08-25 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (AM_CFLAGS): New.
(guile_CFLAGS, libguile_la_CFLAGS): Use it.
2008-08-20 Ludovic Courtès <ludo@gnu.org>
* eval.c, filesys.c, gc.c, numbers.c, stime.c, threads.c: Don't
define `_GNU_SOURCE' explicitly as it's now defined in
<config.h> thanks to `AC_USE_SYSTEM_EXTENSIONS'.
2008-08-19 Han-Wen Nienhuys <hanwen@lilypond.org>
Ludovic Courtès <ludo@gnu.org>
* goops.c (scm_init_goops_builtins, go_to_hell): Fix allocation
of `hell' by passing "hell_size * sizeof (*hell)" instead of
"hell_size" to `scm_malloc ()' and `scm_realloc ()'.
2008-08-02 Neil Jerram <neil@ossau.uklinux.net>
* numbers.c (scm_rationalize): Update docstring to match the
manual (which is more correct). Change argument "err" to "eps",
also to match the manual.
2008-07-17 Neil Jerram <neil@ossau.uklinux.net>
From Thiemo Seufer <ths@networkno.de>:
* gc_os_dep.c (CPP_WORDSZ, ALIGN_DOUBLE, DATAEND,
DYNAMIC_LOADING): Added #defines.
(_fdata, _end): Added declarations.
(DATASTART): Use _fdata instead of __data_start.
(STACKBOTTOM): Changed from 0x80000000 to 0x7fff8000.
2008-07-16 Ludovic Courtès <ludo@gnu.org>
* gen-scmconfig.h.in (SCM_I_GSC_HAVE_STRUCT_DIRENT64): New.
* gen-scmconfig.c (main): Produce definitions of
`SCM_HAVE_STRUCT_DIRENT64' and `SCM_HAVE_READDIR64_R'.
* _scm.h (dirent_or_dirent64): Depend on
`SCM_HAVE_STRUCT_DIRENT64', for the sake of HP-UX 11.11.
(readdir_r_or_readdir64_r): Depend on `SCM_HAVE_READDIR64_R',
for HP-UX 11.11.
2008-07-05 Ludovic Courtès <ludo@gnu.org>
* strings.c (scm_c_symbol_length): New function.
* strings.h (scm_c_symbol_length): New declaration.
2008-07-04 Ludovic Courtès <ludo@gnu.org>
* posix.h (scm_i_locale_mutex): Don't declare as `SCM_INTERNAL'
since it's needed by `libguile-i18n'. Reported by Patrick
Horgan <phorgan1@gmail.com>.
* __scm.h (SCM_INTERNAL): Add `extern' so that these symbols are
not considered as "common" by GCC 4.3. Reported by Patrick
Horgan <phorgan1@gmail.com>.
2008-06-28 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (INCLUDES): Renamed to...
(AM_CPPFLAGS): this, to match current Automake conventions.
Users updated.
* tags.h (SCM_UNPACK): Disable type-checking for `__DECC' and
`__HP_cc'. Reported by Peter O'Gorman <pogma@thewrittenword.com>.
2008-06-02 Ludovic Courtès <ludo@gnu.org>
* deprecated.c (maybe_close_port): Rename EXCEPT to EXCEPT_SET
to workaround `#define except' on Tru64. Reported by Peter
O'Gorman <pogma@thewrittenword.com>.
2008-05-31 Ludovic Courtès <ludo@gnu.org>
* __scm.h (SCM_INTERNAL): New macro.
* *.h: Use it to mark as internal `scm_i_' and `scm_init_'
functions that are not used by public macros or inline
functions.
2008-05-14 Julian Graham <joolean@gmail.com>
* threads.c (fat_mutex)[recursive]: New field.
(make_fat_mutex): Adjust initialization to reflect changes to
mutex lock level semantics.
(fat_mutex_lock, fat_mutex_unlock): Add support for unowned
mutexes and locking mutexes on behalf of other threads.
(scm_lock_mutex, scm_lock_mutex_timed): Update to reflect
signature change to fat_mutex_lock.
(scm_mutex_owner, scm_mutex_level, scm_mutex_locked_p): New /
re-enabled functions.
* threads.h (scm_mutex_owner, scm_mutex_level,
scm_mutex_locked_p): Prototypes for new functions.
2008-05-12 Neil Jerram <neil@ossau.uklinux.net>
* discouraged.c: Expand DEFFROM and DEFTO macros, to avoid
compiler warnings about excess semicolons. (Reported by Didier
Godefroy.)
2008-05-08 Neil Jerram <neil@ossau.uklinux.net>
* throw.c (scm_ithrow): For IA64 add a return statement, to
appease GCC.
* threads.h (scm_i_thread): New IA64 fields:
register_backing_store_base and pending_rbs_continuation.
* threads.c (guilify_self_1): For IA64: cap RBS base address at
the current value of scm_ia64_ar_bsp, and store the capped value
in thread state.
(SCM_MARK_BACKING_STORE): Use thread->register_backing_store_base
instead of scm_ia64_register_backing_store_base().
(scm_threads_mark_stacks): Add "&" in "&t->regs", so that the code
works both for jmp_buf defined as an array, and jmp_buf defined as
a struct.
* continuations.h (scm_t_contregs): Remove `fresh' and `ctx'
fields; these are now inside the IA64 definition of `jmp_buf'.
* continuations.c (scm_make_continuation): Simplify, by moving
some of the IA64 code inside the definition of "setjmp", and by
some obvious commonizations. For IA64 register backing store
(RBS) stack base, use thread->register_backing_store_base instead
of scm_ia64_register_backing_store_base().
(copy_stack): For IA64, store pointer to continuation being
invoked in thread state, so we can restore the continuation's RBS
stack just before the next setcontext call.
(copy_stack_and_call): Don't restore RBS stack explicitly here.
It will be restored, if appropriate, inside the longjmp call.
(scm_ia64_longjmp): New function.
* __scm.h (setjmp, longjmp, jmp_buf): For IA64, implement using
getcontext and setcontext.
2008-05-07 Ludovic Courtès <ludo@gnu.org>
* numbers.c (scm_from_complex_double): Mark as `SCM_UNUSED'.
This fixes compilation with `-Werror' on FreeBSD 6.2 (i386).
2008-05-05 Neil Jerram <neil@ossau.uklinux.net>
* c-tokenize.lex: #define YY_NO_INPUT.
2008-04-26 Ludovic Courtès <ludo@gnu.org>
* read.c (scm_read_sexp): Remove extraneous semi-colon at
end-of-line, which broke compilation with GCC 2.7. Reported by
Alain Guibert <alguibert+bts@free.fr>.
2008-04-24 Ludovic Courtès <ludo@gnu.org>
* Makefile.am (DEFAULT_INCLUDES): New. Fixes compilation on
Tru64 where our "random.h" would shadown libc's one.
(INCLUDES): Add "-I$(top_buildir)", which is normally in
`DEFAULT_INCLUDES'.
* gen-scmconfig.c: Include <libguile/gen-scmconfig.h>, not
"gen-scmconfig.h" since that file is under `$(builddir)'.
2008-04-16 Ludovic Courtès <ludo@gnu.org>
* ports.c (scm_getc, scm_putc, scm_puts): Moved...
* inline.h: ... here. Noticeably improves `read' performance.
2008-04-15 Ludovic Courtès <ludo@gnu.org>
Julian Graham <joolean@gmail.com>
* read.c (scm_keyword_postfix): New.
(scm_read_opts): Update docstring for `keywords'.
(scm_read_mixed_case_symbol): Add support for postfix keywords.
2008-04-13 Ludovic Courtès <ludo@gnu.org>
* inline.h (SCM_C_USE_EXTERN_INLINE): New macro. Use it to make
sure "extern" declarations are produced when "extern inline" is
used. Simplify macrology around inline definitions.
2008-04-10 Ludovic Courtès <ludo@gnu.org>
* inline.h (SCM_C_EXTERN_INLINE): Special-case Apple's GCC
4.0-based compiler, which doesn't support GNU inline semantics
at all in C99 mode but doesn't define `__GNUC_STDC_INLINE__'.
See http://thread.gmane.org/gmane.network.gnutls.general/1135 .
2008-04-10 Andy Wingo <wingo@pobox.com>
* struct.c (scm_struct_ref, scm_struct_set_x): "Light" structs
have no hidden words (members of the SCM_STRUCT_DATA(x) array
accessed with negative indices). In that case, determine the
number of fields from the length of the struct layout
descriptor. (Most GOOPS instances are light structs.)
* goops.c (wrap_init): Initialize 'u' slots to 0, not some random
SCM value.
* goops.c (get_slot_value, set_slot_value): In the struct
allocation case, don't poke the slots array directly -- we should
go through struct-ref/struct-set! code so that we get the
permissions and allocation ('u' versus 'p') correct.
2008-04-03 Ludovic Courtès <ludo@gnu.org>
* inline.h (SCM_C_EXTERN_INLINE): New macro, addresses the
"extern inline" semantic change in C99 mode with GCC 4.3 and
later and the warning in C99 mode with GCC 4.2. Use it in the
inline function definitions.
2008-03-24 Neil Jerram <neil@ossau.uklinux.net>
Applying patch from Julian Graham, containing minor fixes to his
thread enhancements:
* threads.c (to_timespec): Change 1000000 multiplier to
1000000000.
(unchecked_unlock_sym, allow_external_unlock_sym,
recursive_sym): Use SCM_SYMBOL.
(scm_make_mutex_with_flags): When raising unsupported option
error, report what the unsupported option was.
(fat_mutex_unlock): When raising errors, unlock m->lock first.
(fat_cond_timedwait): Removed.
(scm_timed_wait_condition_variable): Call fat_mutex_unlock
directly instead of via fat_cond_timedwait.
2008-03-10 Ludovic Courtès <ludo@gnu.org>
* eval.c, filesys.c: Enclose `alloca' blob in `#ifndef alloca',
as per Gnulib's `alloca'. This should fix compilation on
FreeBSD 6.
2008-03-09 Neil Jerram <neil@ossau.uklinux.net>
* numbers.c: Only define scm_from_complex_double if it will
actually be used.
2008-03-08 Julian Graham <joolean@gmail.com>
* threads.c (scm_join_thread_timed, scm_thread_p,
scm_make_mutex_with_flags, scm_lock_mutex_timed,
scm_unlock_mutex_timed, scm_mutex_p, scm_condition_variable_p): New
functions.
(thread_mark): Updated to mark new struct field `mutexes'.
(do_thread_exit): Notify threads waiting on mutexes locked by exiting
thread.
(scm_join_thread, scm_make_mutex, scm_make_recursive_mutex,
scm_mutex_lock): Reimplement in terms of their newer
counterparts.
(scm_abandoned_mutex_error_key): New symbol.
(fat_mutex)[unchecked_unlock, allow_external_unlock]: New fields.
(fat_mutex_lock): Reimplement to support timeouts and abandonment.
(fat_mutex_trylock, scm_try_mutex): Remove fat_mutex_trylock and
reimplement scm_try_mutex as a lock attempt with a timeout of zero.
(fat_mutex_unlock): Allow unlocking from other threads and unchecked
unlocking; implement in terms of condition variable wait.
(scm_timed_wait_condition_variable): Reimplement in terms of
fat_mutex_unlock.
* threads.h (scm_i_thread)[mutexes]: New field.
(scm_join_thread_timed, scm_thread_p, scm_lock_mutex_timed,
scm_unlock_mutex_timed, scm_mutex_p, scm_condition_variable_p):
Prototypes for new functions.
2008-03-06 Ludovic Courtès <ludo@gnu.org>
* eval.c (scm_eval): If MODULE_OR_STATE is not a dynamic state,
make sure it's a module. Reported by David I. Lehn.
2008-03-02 Ludovic Courtès <ludo@gnu.org>
* pairs.h (scm_is_pair): Moved declaration to `inline.h'.
* inline.h: Make sure `extern' declarations are not produced
when `inline' is supported but GCC is not used. This
fixes "mixed linkage" errors with compilers such as
DEC/Compaq/HP CC.
2008-02-27 Neil Jerram <neil@ossau.uklinux.net>
* _scm.h (errno): Remove declarations that have been there
forever, and are known to conflict on some platforms with that
provided by <errno.h>, which we include unconditionally. If
<errno.h> doesn't provide a errno declaration, what is the point
of it?
2008-02-23 Ludovic Courtès <ludo@gnu.org>
* numbers.c (scm_make_rectangular): Rename argument to
`real_part' and `imaginary_part' to work around Solaris 2.10
headers which define `imaginary' as a macro. Patch by Tim
Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>.
2008-02-22 Ludovic Courtès <ludo@gnu.org>
* read.c (strncasecmp): Add declaration when
`HAVE_DECL_STRNCASECMP' is undefined. Fixes compilation on
NetBSD 1.6.
* gc.c (scm_ia64_ar_bsp)[linux]: Don't discard `const' qualifier
of OPAQUE.
2008-02-21 Ludovic Courtès <ludo@gnu.org>
Fix bug #22369.
* goops.c (scm_add_slot): Add `SCM_UNDEFINED' as last argument
to `scm_list_n ()'. Thanks to René Köcher
<shirk87@googlemail.com>.
2008-02-17 Ludovic Courtès <ludo@gnu.org>
* script.c (scm_compile_shell_switches): Update copyright year.
2008-02-16 Ludovic Courtès <ludo@gnu.org>
* gc_os_dep.c: Add NetBSD/alpha support. Patch by Greg Troxel
<gdt@ir.bbn.com>.
2008-02-12 Ludovic Courtès <ludo@gnu.org>
* guile-snarf.in (tempdir): Honor `$TMPDIR'.
2008-02-11 Neil Jerram <neil@ossau.uklinux.net>
* numbers.c (SCM_COMPLEX_VALUE): Use GUILE_I instead of _Complex_I
directly, and only if GUILE_I was defined by the configure step.
(scm_log, scm_log10, scm_exp, scm_sqrt): Use SCM_COMPLEX_VALUE
code only if SCM_COMPLEX_VALUE is defined.
2008-02-07 Ludovic Courtès <ludo@gnu.org>
Fix bug #21378.
Thanks to David Diffenbaugh <davediff@nbcs.rutgers.edu>.
* read.c (scm_read_quote): Don't use `__FUNCTION__' since it is
not supported by Sun CC on Solaris 9.
(scm_read_keyword): Likewise.
* strings.c (scm_take_locale_stringn): Remove
`SCM_C_INLINE_KEYWORD' to allow compilation with Sun CC.
2008-02-07 Julian Graham <joolean@gmail.com>
* threads.c (do_thread_exit, scm_cancel_thread,
scm_set_thread_cleanup_x, scm_thread_cleanup): Lock on thread-specific
admin mutex instead of `thread_admin_mutex'.
* threads.h (scm_i_thread)[admin_mutex]: New field.
* throw.c (make_jmpbuf): Don't enter critical section during thread
spawn -- there is a possibility of deadlock if other threads are
exiting.
2008-02-06 Neil Jerram <neil@ossau.uklinux.net>
* gc-malloc.c (scm_gc_malloc): Return NULL if requested size is 0.
(scm_gc_free): Don't call `free' if mem is NULL.
2008-02-06 Ludovic Courtès <ludo@gnu.org>
* numbers.c (scm_i_mkbig, scm_i_long2big, scm_i_ulong2big,
scm_i_clonebig, scm_i_bigcmp, scm_i_dbl2big, scm_i_dbl2num,
scm_i_normbig): Remove `SCM_C_INLINE_KEYWORD' since these are
declared as `extern' in `numbers.h'. This precluded compilation
on Solaris 9 with Sun CC (reported by David Halik
<dhalik@nbcs.rutgers.edu>).
2008-02-05 Neil Jerram <neil@ossau.uklinux.net>
* fports.c (fport_seek): Make dependent on GUILE_USE_64_CALLS.
* _scm.h: Make definition of CHOOSE_LARGEFILE depend on
GUILE_USE_64_CALLS.
2008-02-01 Neil Jerram <neil@ossau.uklinux.net>
* modules.c (the_root_module): Moved before scm_current_module.
(scm_current_module): Return the root module if `the-module' fluid
gives #f.
2008-01-22 Neil Jerram <neil@ossau.uklinux.net>
* COPYING: Removed.
* __scm.h, _scm.h, weaks.c: Update copyright statement to LGPL.
2008-01-18 Neil Jerram <neil@ossau.uklinux.net>
* hashtab.c (scm_hash_fn_create_handle_x): If supplied assoc_fn
returns neither a pair nor #f, signal a wrong-type-arg error.
(Thanks to Gregory Marton for reporting this.)
2007-12-29 Neil Jerram <neil@ossau.uklinux.net>
* gc.c (mark_gc_async): Change "func_data" to "fn_data", to avoid
clash with AIX header file.
* hooks.c (scm_c_hook_add, scm_c_hook_remove): Same again.
* hooks.h (scm_t_c_hook_function, scm_c_hook_add,
scm_c_hook_remove): Same again.
2007-12-08 Ludovic Courtès <ludo@gnu.org>
* __scm.h (SCM_EXPECT, SCM_LIKELY, SCM_UNLIKELY): New macros.
(SCM_ASSERT, SCM_ASSERT_TYPE, SCM_ASRTGO, SCM_GASSERT0,
SCM_GASSERT1, SCM_GASSERT2, SCM_GASSERTn): Use them.
* eval.c (ASSERT_SYNTAX, ASSERT_SYNTAX_2): Likewise.
* eval.i.c (CEVAL): Use branch prediction hints for syntax
errors, wrong number of arguments and similar.
* numbers.c (scm_sum): Use `SCM_LIKELY' for the sum of two
immediate numbers.
(scm_difference, scm_product, scm_i_divide): Likewise.
* validate.h (SCM_ASSERT_RANGE): Use `SCM_UNLIKELY'.
2007-12-04 Ludovic Courtès <ludo@gnu.org>
* ports.c (scm_c_read): Validate PORT as an open input port.
(scm_c_write): Validate PORT as an open output port.
* socket.c (scm_accept): Leave guile mode using
`scm_std_select ()' before calling `accept(2)'. Reported by
dskr <dskr@mac.com>.
2007-10-27 Ludovic Courtès <ludo@gnu.org>
* fports.c (scm_i_evict_port): Expect a port, rather than a pair
containing the port. Fixes a bug in the new port table (2007-08-26).
(scm_evict_ports): Use `scm_c_port_for_each ()'.
2007-10-21 Neil Jerram <neil@ossau.uklinux.net>
* eval.c (unmemoize_delay): Extend the environment before
unmemoizing the promise thunk. This fixes a segmentation fault
reported by Frank Schwidom.
2007-10-20 Julian Graham <joolean@gmail.com> 2007-10-20 Julian Graham <joolean@gmail.com>
Add support for thread cancellation and user-defined thread Add support for thread cancellation and user-defined thread

View file

@ -1,6 +1,6 @@
## Process this file with Automake to create Makefile.in ## Process this file with Automake to create Makefile.in
## ##
## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. ## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
## ##
## This file is part of GUILE. ## This file is part of GUILE.
## ##
@ -23,12 +23,20 @@ AUTOMAKE_OPTIONS = gnu
## Prevent automake from adding extra -I options ## Prevent automake from adding extra -I options
DEFS = @DEFS@ DEFS = @DEFS@
# Override Automake's `DEFAULT_INCLUDES'. By default, it contains
# "-I$(srcdir)", which causes problems on Tru64 where our "random.h"
# is picked up by <stdlib.h> instead of the libc's <random.h>.
DEFAULT_INCLUDES =
## Check for headers in $(srcdir)/.., so that #include ## Check for headers in $(srcdir)/.., so that #include
## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're ## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
## building. Also look for Gnulib headers in `lib'. ## building. Also look for Gnulib headers in `lib'.
INCLUDES = -I.. -I$(top_srcdir) \ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \
-I$(top_srcdir)/lib -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_builddir)/lib
AM_CFLAGS = $(GCC_CFLAGS)
## The Gnulib Libtool archive. ## The Gnulib Libtool archive.
gnulib_library = $(top_builddir)/lib/libgnu.la gnulib_library = $(top_builddir)/lib/libgnu.la
@ -47,7 +55,7 @@ gen_scmconfig_SOURCES = gen-scmconfig.c
## For some reason, OBJEXT does not include the dot ## For some reason, OBJEXT does not include the dot
gen-scmconfig.$(OBJEXT): gen-scmconfig.c gen-scmconfig.$(OBJEXT): gen-scmconfig.c
if [ "$(cross_compiling)" = "yes" ]; then \ if [ "$(cross_compiling)" = "yes" ]; then \
$(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ $<; \ $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \
else \ else \
$(COMPILE) -c -o $@ $<; \ $(COMPILE) -c -o $@ $<; \
fi fi
@ -75,7 +83,7 @@ guile_filter_doc_snarfage_SOURCES = c-tokenize.c
## For some reason, OBJEXT does not include the dot ## For some reason, OBJEXT does not include the dot
c-tokenize.$(OBJEXT): c-tokenize.c c-tokenize.$(OBJEXT): c-tokenize.c
if [ "$(cross_compiling)" = "yes" ]; then \ if [ "$(cross_compiling)" = "yes" ]; then \
$(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<; \ $(CC_FOR_BUILD) $(DEFS) $(AM_CPPFLAGS) -c -o $@ $<; \
else \ else \
$(COMPILE) -c -o $@ $<; \ $(COMPILE) -c -o $@ $<; \
fi fi
@ -91,11 +99,11 @@ guile_filter_doc_snarfage$(EXEEXT): $(guile_filter_doc_snarfage_OBJECTS) $(guile
guile_SOURCES = guile.c guile_SOURCES = guile.c
guile_CFLAGS = $(GUILE_CFLAGS) guile_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
guile_LDADD = libguile.la guile_LDADD = libguile.la
guile_LDFLAGS = @DLPREOPEN@ $(GUILE_CFLAGS) guile_LDFLAGS = @DLPREOPEN@ $(GUILE_CFLAGS)
libguile_la_CFLAGS = $(GUILE_CFLAGS) libguile_la_CFLAGS = $(GUILE_CFLAGS) $(AM_CFLAGS)
libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \ libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
chars.c continuations.c convert.c debug.c deprecation.c \ chars.c continuations.c convert.c debug.c deprecation.c \
@ -282,7 +290,7 @@ libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status
@mv libpath.tmp libpath.h @mv libpath.tmp libpath.h
snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
SUFFIXES = .x .doc SUFFIXES = .x .doc
.c.x: .c.x:
@ -332,7 +340,7 @@ schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
schemelib_DATA = guile-procedures.txt schemelib_DATA = guile-procedures.txt
## Add -MG to make the .x magic work with auto-dep code. ## Add -MG to make the .x magic work with auto-dep code.
MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk cpp_err_symbols.c: cpp_err_symbols.in cpp_cnvt.awk
$(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \ $(AWK) -f $(srcdir)/cpp_cnvt.awk < $(srcdir)/cpp_err_symbols.in > \

View file

@ -3,46 +3,22 @@
#ifndef SCM___SCM_H #ifndef SCM___SCM_H
#define SCM___SCM_H #define SCM___SCM_H
/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003, 2006 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003, 2006, 2007, 2008 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU Lesser General Public
* the Free Software Foundation; either version 2, or (at your option) * License as published by the Free Software Foundation; either
* any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU Lesser General Public
* along with this software; see the file COPYING. If not, write to * License along with this library; if not, write to the Free Software
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Boston, MA 02110-1301 USA */
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
*
* The exception is that, if you link the GUILE library with other files
* to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the GUILE library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the
* Free Software Foundation under the name GUILE. If you copy
* code from other Free Software Foundation releases into a copy of
* GUILE, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
@ -109,6 +85,29 @@
#endif #endif
/* The SCM_EXPECT macros provide branch prediction hints to the compiler. To
* use only in places where the result of the expression under "normal"
* circumstances is known. */
#if defined(__GNUC__) && (__GNUC__ >= 3)
# define SCM_EXPECT __builtin_expect
#else
# define SCM_EXPECT(_expr, _value) (_expr)
#endif
#define SCM_LIKELY(_expr) SCM_EXPECT ((_expr), 1)
#define SCM_UNLIKELY(_expr) SCM_EXPECT ((_expr), 0)
/* The SCM_INTERNAL macro makes it possible to explicitly declare a function
* as having "internal" linkage. */
#if (defined __GNUC__) && \
((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ == 3))
# define SCM_INTERNAL extern __attribute__ ((__visibility__ ("internal")))
#else
# define SCM_INTERNAL extern
#endif
/* {Supported Options} /* {Supported Options}
* *
* These may be defined or undefined. * These may be defined or undefined.
@ -198,6 +197,14 @@
#define SCM_DEBUG 0 #define SCM_DEBUG 0
#endif #endif
/* For debugging purposes: define this is to ensure nobody is using
* the mark bits outside of the marking phase. This is meant for
* debugging purposes only.
*/
#ifndef SCM_DEBUG_MARKING_API
#define SCM_DEBUG_MARKING_API 0
#endif
/* If SCM_DEBUG_CELL_ACCESSES is set to 1, cell accesses will perform /* If SCM_DEBUG_CELL_ACCESSES is set to 1, cell accesses will perform
* exhaustive parameter checking: It will be verified that cell parameters * exhaustive parameter checking: It will be verified that cell parameters
* actually point to a valid heap cell. Note: If this option is enabled, * actually point to a valid heap cell. Note: If this option is enabled,
@ -412,7 +419,23 @@
# define setjmp setjump # define setjmp setjump
# define longjmp longjump # define longjmp longjump
# else /* ndef _CRAY1 */ # else /* ndef _CRAY1 */
# if defined (__ia64__)
/* For IA64, emulate the setjmp API using getcontext. */
# include <signal.h>
# include <ucontext.h>
typedef struct {
ucontext_t ctx;
int fresh;
} jmp_buf;
# define setjmp(JB) \
( (JB).fresh = 1, \
getcontext (&((JB).ctx)), \
((JB).fresh ? ((JB).fresh = 0, 0) : 1) )
# define longjmp(JB,VAL) scm_ia64_longjmp (&(JB), VAL)
void scm_ia64_longjmp (jmp_buf *, int);
# else /* ndef __ia64__ */
# include <setjmp.h> # include <setjmp.h>
# endif /* ndef __ia64__ */
# endif /* ndef _CRAY1 */ # endif /* ndef _CRAY1 */
#endif /* ndef vms */ #endif /* ndef vms */
@ -501,13 +524,13 @@ do { \
#define SCM_ASRTGO(_cond, _label) #define SCM_ASRTGO(_cond, _label)
#else #else
#define SCM_ASSERT(_cond, _arg, _pos, _subr) \ #define SCM_ASSERT(_cond, _arg, _pos, _subr) \
do { if (!(_cond)) \ do { if (SCM_UNLIKELY (!(_cond))) \
scm_wrong_type_arg (_subr, _pos, _arg); } while (0) scm_wrong_type_arg (_subr, _pos, _arg); } while (0)
#define SCM_ASSERT_TYPE(_cond, _arg, _pos, _subr, _msg) \ #define SCM_ASSERT_TYPE(_cond, _arg, _pos, _subr, _msg) \
do { if (!(_cond)) \ do { if (SCM_UNLIKELY (!(_cond))) \
scm_wrong_type_arg_msg(_subr, _pos, _arg, _msg); } while (0) scm_wrong_type_arg_msg(_subr, _pos, _arg, _msg); } while (0)
#define SCM_ASRTGO(_cond, _label) \ #define SCM_ASRTGO(_cond, _label) \
do { if (!(_cond)) \ do { if (SCM_UNLIKELY (!(_cond))) \
goto _label; } while (0) goto _label; } while (0)
#endif #endif
@ -527,7 +550,8 @@ SCM_API SCM scm_call_generic_0 (SCM gf);
? scm_call_generic_0 ((gf)) \ ? scm_call_generic_0 ((gf)) \
: (scm_error_num_args_subr ((subr)), SCM_UNSPECIFIED)) : (scm_error_num_args_subr ((subr)), SCM_UNSPECIFIED))
#define SCM_GASSERT0(cond, gf, subr) \ #define SCM_GASSERT0(cond, gf, subr) \
if (!(cond)) SCM_WTA_DISPATCH_0((gf), (subr)) if (SCM_UNLIKELY(!(cond))) \
SCM_WTA_DISPATCH_0((gf), (subr))
SCM_API SCM scm_call_generic_1 (SCM gf, SCM a1); SCM_API SCM scm_call_generic_1 (SCM gf, SCM a1);
@ -536,7 +560,8 @@ SCM_API SCM scm_call_generic_1 (SCM gf, SCM a1);
? scm_call_generic_1 ((gf), (a1)) \ ? scm_call_generic_1 ((gf), (a1)) \
: (scm_wrong_type_arg ((subr), (pos), (a1)), SCM_UNSPECIFIED)) : (scm_wrong_type_arg ((subr), (pos), (a1)), SCM_UNSPECIFIED))
#define SCM_GASSERT1(cond, gf, a1, pos, subr) \ #define SCM_GASSERT1(cond, gf, a1, pos, subr) \
if (!(cond)) SCM_WTA_DISPATCH_1((gf), (a1), (pos), (subr)) if (SCM_UNLIKELY (!(cond))) \
SCM_WTA_DISPATCH_1((gf), (a1), (pos), (subr))
SCM_API SCM scm_call_generic_2 (SCM gf, SCM a1, SCM a2); SCM_API SCM scm_call_generic_2 (SCM gf, SCM a1, SCM a2);
@ -547,7 +572,8 @@ SCM_API SCM scm_call_generic_2 (SCM gf, SCM a1, SCM a2);
(pos) == SCM_ARG1 ? (a1) : (a2)), \ (pos) == SCM_ARG1 ? (a1) : (a2)), \
SCM_UNSPECIFIED)) SCM_UNSPECIFIED))
#define SCM_GASSERT2(cond, gf, a1, a2, pos, subr) \ #define SCM_GASSERT2(cond, gf, a1, a2, pos, subr) \
if (!(cond)) SCM_WTA_DISPATCH_2((gf), (a1), (a2), (pos), (subr)) if (SCM_UNLIKELY (!(cond))) \
SCM_WTA_DISPATCH_2((gf), (a1), (a2), (pos), (subr))
SCM_API SCM scm_apply_generic (SCM gf, SCM args); SCM_API SCM scm_apply_generic (SCM gf, SCM args);
@ -559,7 +585,8 @@ SCM_API SCM scm_apply_generic (SCM gf, SCM args);
scm_from_int ((pos) - 1))), \ scm_from_int ((pos) - 1))), \
SCM_UNSPECIFIED)) SCM_UNSPECIFIED))
#define SCM_GASSERTn(cond, gf, args, pos, subr) \ #define SCM_GASSERTn(cond, gf, args, pos, subr) \
if (!(cond)) SCM_WTA_DISPATCH_n((gf), (args), (pos), (subr)) if (SCM_UNLIKELY (!(cond))) \
SCM_WTA_DISPATCH_n((gf), (args), (pos), (subr))
#ifndef SCM_MAGIC_SNARFER #ifndef SCM_MAGIC_SNARFER
/* Let these macros pass through if /* Let these macros pass through if

View file

@ -3,46 +3,22 @@
#ifndef SCM__SCM_H #ifndef SCM__SCM_H
#define SCM__SCM_H #define SCM__SCM_H
/* Copyright (C) 1995,1996,2000,2001, 2002, 2006 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,2000,2001, 2002, 2006, 2008 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or
* it under the terms of the GNU General Public License as published by * modify it under the terms of the GNU Lesser General Public
* the Free Software Foundation; either version 2, or (at your option) * License as published by the Free Software Foundation; either
* any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* GNU General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU Lesser General Public
* along with this software; see the file COPYING. If not, write to * License along with this library; if not, write to the Free Software
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Boston, MA 02110-1301 USA */
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
*
* The exception is that, if you link the GUILE library with other files
* to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the GUILE library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the
* Free Software Foundation under the name GUILE. If you copy
* code from other Free Software Foundation releases into a copy of
* GUILE, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
@ -119,14 +95,6 @@
# define SCM_SYSCALL(line) line; # define SCM_SYSCALL(line) line;
#endif /* ndef SCM_SYSCALL */ #endif /* ndef SCM_SYSCALL */
#if !defined (MSDOS) && !defined (__MINGW32__)
# ifdef ARM_ULIB
extern volatile int errno;
# else
extern int errno;
# endif /* def ARM_ULIB */
#endif /* ndef MSDOS && ndef __MINGW32__*/
#ifndef min #ifndef min
@ -138,14 +106,18 @@
#if HAVE_STAT64 #if GUILE_USE_64_CALLS && HAVE_STAT64
#define CHOOSE_LARGEFILE(foo,foo64) foo64 #define CHOOSE_LARGEFILE(foo,foo64) foo64
#else #else
#define CHOOSE_LARGEFILE(foo,foo64) foo #define CHOOSE_LARGEFILE(foo,foo64) foo
#endif #endif
/* These names are a bit long, but they make it clear what they represent. */ /* These names are a bit long, but they make it clear what they represent. */
#if SCM_HAVE_STRUCT_DIRENT64 == 1
# define dirent_or_dirent64 CHOOSE_LARGEFILE(dirent,dirent64) # define dirent_or_dirent64 CHOOSE_LARGEFILE(dirent,dirent64)
#else
# define dirent_or_dirent64 dirent
#endif
#define fstat_or_fstat64 CHOOSE_LARGEFILE(fstat,fstat64) #define fstat_or_fstat64 CHOOSE_LARGEFILE(fstat,fstat64)
#define ftruncate_or_ftruncate64 CHOOSE_LARGEFILE(ftruncate,ftruncate64) #define ftruncate_or_ftruncate64 CHOOSE_LARGEFILE(ftruncate,ftruncate64)
#define lseek_or_lseek64 CHOOSE_LARGEFILE(lseek,lseek64) #define lseek_or_lseek64 CHOOSE_LARGEFILE(lseek,lseek64)
@ -153,7 +125,11 @@
#define off_t_or_off64_t CHOOSE_LARGEFILE(off_t,off64_t) #define off_t_or_off64_t CHOOSE_LARGEFILE(off_t,off64_t)
#define open_or_open64 CHOOSE_LARGEFILE(open,open64) #define open_or_open64 CHOOSE_LARGEFILE(open,open64)
#define readdir_or_readdir64 CHOOSE_LARGEFILE(readdir,readdir64) #define readdir_or_readdir64 CHOOSE_LARGEFILE(readdir,readdir64)
#if SCM_HAVE_READDIR64_R == 1
# define readdir_r_or_readdir64_r CHOOSE_LARGEFILE(readdir_r,readdir64_r) # define readdir_r_or_readdir64_r CHOOSE_LARGEFILE(readdir_r,readdir64_r)
#else
# define readdir_r_or_readdir64_r readdir_r
#endif
#define stat_or_stat64 CHOOSE_LARGEFILE(stat,stat64) #define stat_or_stat64 CHOOSE_LARGEFILE(stat,stat64)
#define truncate_or_truncate64 CHOOSE_LARGEFILE(truncate,truncate64) #define truncate_or_truncate64 CHOOSE_LARGEFILE(truncate,truncate64)
#define scm_from_off_t_or_off64_t CHOOSE_LARGEFILE(scm_from_off_t,scm_from_int64) #define scm_from_off_t_or_off64_t CHOOSE_LARGEFILE(scm_from_off_t,scm_from_int64)

View file

@ -3,7 +3,7 @@
#ifndef SCM_ALIST_H #ifndef SCM_ALIST_H
#define SCM_ALIST_H #define SCM_ALIST_H
/* Copyright (C) 1995,1996,2000, 2006 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,2000, 2006, 2008 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -42,7 +42,7 @@ SCM_API SCM scm_assoc_set_x (SCM alist, SCM key, SCM val);
SCM_API SCM scm_assq_remove_x (SCM alist, SCM key); SCM_API SCM scm_assq_remove_x (SCM alist, SCM key);
SCM_API SCM scm_assv_remove_x (SCM alist, SCM key); SCM_API SCM scm_assv_remove_x (SCM alist, SCM key);
SCM_API SCM scm_assoc_remove_x (SCM alist, SCM key); SCM_API SCM scm_assoc_remove_x (SCM alist, SCM key);
SCM_API void scm_init_alist (void); SCM_INTERNAL void scm_init_alist (void);
#endif /* SCM_ALIST_H */ #endif /* SCM_ALIST_H */

Some files were not shown because too many files have changed in this diff Show more