code:
dnl   configuration script for Guile
dnl   Process this file with autoconf to produce configure.
dnl

define(GUILE_CONFIGURE_COPYRIGHT,[[

Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.

This file is part of GUILE

GUILE 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.

GUILE 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 GUILE; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

]])

AC_PREREQ(2.61)

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  Builtins"), in particular on solaris it results in a literal "-n" in
dnl  the output.
dnl
AC_INIT(patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${PACKAGE}),[
]),
        patsubst(m4_esyscmd(. ./GUILE-VERSION && echo ${GUILE_VERSION}),[
]),
        [bug-guile@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(GUILE-VERSION)

AM_INIT_AUTOMAKE([gnu no-define check-news -Wall -Wno-override])

AC_COPYRIGHT(GUILE_CONFIGURE_COPYRIGHT)
AC_CONFIG_SRCDIR([GUILE-VERSION])

. $srcdir/GUILE-VERSION

AC_CONFIG_HEADERS([config.h])
AH_TOP(/*GUILE_CONFIGURE_COPYRIGHT*/)

#--------------------------------------------------------------------
#
# Independent Subdirectories
#
#--------------------------------------------------------------------

AC_CONFIG_SUBDIRS(guile-readline)

#--------------------------------------------------------------------

AC_LANG([C])

dnl Some more checks for Win32
AC_CANONICAL_HOST

AB_INIT

AC_LIBTOOL_WIN32_DLL

AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CPP
AC_PROG_AWK

AC_USE_SYSTEM_EXTENSIONS

AC_PROG_CC_C89

# for per-target cflags in the libguile subdir
AM_PROG_CC_C_O

AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_CHECK_LIB([ltdl], [lt_dlinit], ,
  [AC_MSG_ERROR([libltdl not found.  See README.])])
AC_CHECK_HEADER([ltdl.h], [],
  [AC_MSG_ERROR([<ltdl.h> not found.  See README.])])

AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)

AM_PATH_LISPDIR

#--------------------------------------------------------------------
#
# User options (after above tests that may set default CFLAGS etc.)
#
#--------------------------------------------------------------------

GUILE_ERROR_ON_WARNING="yes"

AC_ARG_ENABLE(error-on-warning,
  [  --enable-error-on-warning    treat compile warnings as errors],
  [case "${enableval}" in
     yes | y) GUILE_ERROR_ON_WARNING="yes" ;;
     no | n)  GUILE_ERROR_ON_WARNING="no" ;;
     *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
   esac])

SCM_I_GSC_GUILE_DEBUG_FREELIST=0
AC_ARG_ENABLE(debug-freelist,
  [  --enable-debug-freelist include garbage collector freelist debugging code],
  if test "$enable_debug_freelist" = y \
     || test "$enable_debug_freelist" = yes; then
    SCM_I_GSC_GUILE_DEBUG_FREELIST=1
  fi)

AC_ARG_ENABLE(debug-malloc,
  [  --enable-debug-malloc   include malloc debugging code],
  if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
    AC_DEFINE(GUILE_DEBUG_MALLOC, 1,
      [Define this if you want to debug scm_must_malloc/realloc/free calls.])
  fi)

SCM_I_GSC_GUILE_DEBUG=0
AC_ARG_ENABLE(guile-debug,
  [AS_HELP_STRING([--enable-guile-debug],
                  [include internal debugging functions])],
  if test "$enable_guile_debug" = y || test "$enable_guile_debug" = yes; then
    SCM_I_GSC_GUILE_DEBUG=1
  fi)

AC_ARG_ENABLE(posix,
  [  --disable-posix         omit posix interfaces],,
  enable_posix=yes)

AC_ARG_ENABLE(networking,
  [  --disable-networking    omit networking interfaces],,
  enable_networking=yes)

AC_ARG_ENABLE(regex,
  [  --disable-regex         omit regular expression interfaces],,
  enable_regex=yes)

AC_ARG_ENABLE([discouraged],
  AS_HELP_STRING([--disable-discouraged],[omit discouraged features]))

if test "$enable_discouraged" = no; then
  SCM_I_GSC_ENABLE_DISCOURAGED=0
else
  SCM_I_GSC_ENABLE_DISCOURAGED=1
fi

AC_ARG_ENABLE([deprecated],
  AS_HELP_STRING([--disable-deprecated],[omit deprecated features]))

if test "$enable_deprecated" = no; then
  SCM_I_GSC_ENABLE_DEPRECATED=0
  warn_default=no
else
  if test "$enable_deprecated" = yes || test "$enable_deprecated" = ""; then
    warn_default=summary
  elif test "$enable_deprecated" = shutup; then
    warn_default=no
  else
    warn_default=$enable_deprecated
  fi
  SCM_I_GSC_ENABLE_DEPRECATED=1
fi
AC_DEFINE_UNQUOTED(SCM_WARN_DEPRECATED_DEFAULT, "$warn_default",
[Define this to control the default warning level for deprecated features.])

AC_ARG_ENABLE(elisp,
  [  --disable-elisp         omit Emacs Lisp support],,
  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

AC_MSG_CHECKING([whether the compiler defaults to IEEE floating point behavior])
# The following snippet was taken from Gnulib's `fpieee'.  See also the definition
# of `guile_NaN' in `numbers.c'.

# IEEE behaviour is the default on all CPUs except Alpha and SH
# (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
# and the GCC 4.1.2 manual).
case "$host_cpu" in
alpha*)
  # On Alpha systems, a compiler option provides the behaviour.
  # See the ieee(3) manual page, also available at
  # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
  AC_MSG_RESULT([no])
  if test -n "$GCC"; then
    # GCC has the option -mieee.
    CPPFLAGS="$CPPFLAGS -mieee"
  else
    # Compaq (ex-DEC) C has the option -ieee.
    CPPFLAGS="$CPPFLAGS -ieee"
  fi
  ;;
sh*)
  AC_MSG_RESULT([no])
  if test -n "$GCC"; then
    # GCC has the option -mieee.
    CPPFLAGS="$CPPFLAGS -mieee"
  fi
  ;;
*)
  AC_MSG_RESULT([yes])
  ;;
esac

#--------------------------------------------------------------------

dnl Check for dynamic linking

use_modules=yes
AC_ARG_WITH(modules,
[  --with-modules[=FILES]  Add support for dynamic modules],
use_modules="$withval")
test -z "$use_modules" && use_modules=yes
DLPREOPEN=
if test "$use_modules" != no; then
  if test "$use_modules" = yes; then
    DLPREOPEN="-dlpreopen force"
  else
    DLPREOPEN="-export-dynamic"
    for module in $use_modules; do
      DLPREOPEN="$DLPREOPEN -dlopen $module"
    done
  fi
fi

dnl files which are destined for separate modules.

if test "$use_modules" != no; then
   AC_LIBOBJ([dynl])
fi

if test "$enable_posix" = yes; then
   AC_LIBOBJ([filesys])
   AC_LIBOBJ([posix])
   AC_DEFINE(HAVE_POSIX, 1,
     [Define this if you want support for POSIX system calls in Guile.])
fi

if test "$enable_networking" = yes; then
   AC_LIBOBJ([net_db])
   AC_LIBOBJ([socket])
   AC_DEFINE(HAVE_NETWORKING, 1,
     [Define this if you want support for networking in Guile.])
fi

if test "$enable_debug_malloc" = yes; then
   AC_LIBOBJ([debug-malloc])
fi

if test "$enable_elisp" = yes; then
  SCM_I_GSC_ENABLE_ELISP=1
else
  SCM_I_GSC_ENABLE_ELISP=0
fi
AC_CHECK_LIB(uca, __uc_get_ar_bsp)

AC_C_CONST

# "volatile" is used in a couple of tests below.
AC_C_VOLATILE

AC_C_INLINE
if test "$ac_cv_c_inline" != no; then
  SCM_I_GSC_C_INLINE="\"${ac_cv_c_inline}\""
else
  SCM_I_GSC_C_INLINE=NULL
fi
AC_CHECK_LIB(uca, __uc_get_ar_bsp)

AC_C_BIGENDIAN

AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(unsigned char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(__int64)
AC_CHECK_SIZEOF(unsigned __int64)
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(intptr_t)
AC_CHECK_SIZEOF(uintptr_t)
AC_CHECK_SIZEOF(ptrdiff_t)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(off_t)

if test "$ac_cv_sizeof_long" -ne "$ac_cv_sizeof_void_p"; then
  AC_MSG_ERROR(sizes of long and void* are not identical)
fi

if test "$ac_cv_sizeof_ptrdiff_t" -ne 0; then
  SCM_I_GSC_T_PTRDIFF='"ptrdiff_t"'
else
  SCM_I_GSC_T_PTRDIFF='"long"'
fi
AC_SUBST([SCM_I_GSC_T_PTRDIFF])

AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([inttypes.h])

AC_CHECK_SIZEOF(intmax_t)

SCM_I_GSC_NEEDS_STDINT_H=0
SCM_I_GSC_NEEDS_INTTYPES_H=0

### intptr and uintptr (try not to use inttypes if we don't have to)
if test "$ac_cv_header_inttypes_h" = yes; then
  if test "$ac_cv_sizeof_intptr_t" -eq 0; then
    AC_CHECK_SIZEOF([intptr_t],,[#include <inttypes.h>
#include <stdio.h>])
    if test "$ac_cv_sizeof_intptr_t" -ne 0; then
      SCM_I_GSC_NEEDS_INTTYPES_H=1
    fi
  fi
  if test "$ac_cv_sizeof_uintptr_t" -eq 0; then
    AC_CHECK_SIZEOF([uintptr_t],,[#include <inttypes.h>
#include <stdio.h>])
    if test "$ac_cv_sizeof_uintptr_t" -ne 0; then
      SCM_I_GSC_NEEDS_INTTYPES_H=1
    fi
  fi
fi

### See what's provided by stdint.h
if test "$ac_cv_header_stdint_h" = yes; then
   AC_CHECK_TYPE([int8_t],[scm_stdint_has_int8=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([uint8_t],[scm_stdint_has_uint8=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([int16_t],[scm_stdint_has_int16=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([uint16_t],[scm_stdint_has_uint16=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([int32_t],[scm_stdint_has_int32=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([uint32_t],[scm_stdint_has_uint32=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([int64_t],[scm_stdint_has_int64=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([uint64_t],[scm_stdint_has_uint64=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([intmax_t],[scm_stdint_has_intmax=1],,[#include <stdint.h>])
   AC_CHECK_TYPE([uintmax_t],[scm_stdint_has_uintmax=1],,[#include <stdint.h>])
fi

# so we don't get confused by the cache (wish there was a better way
# to check particular headers for the same type...)

unset ac_cv_type_int8_t
unset ac_cv_type_uint8_t
unset ac_cv_type_int16_t
unset ac_cv_type_uint16_t
unset ac_cv_type_int32_t
unset ac_cv_type_uint32_t
unset ac_cv_type_int64_t
unset ac_cv_type_uint64_t
unset ac_cv_type_intmax_t
unset ac_cv_type_uintmax_t

### See what's provided by inttypes.h
if test "$ac_cv_header_inttypes_h" = yes; then
  AC_CHECK_TYPE([int8_t],[scm_inttypes_has_int8=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([uint8_t],[scm_inttypes_has_uint8=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([int16_t],[scm_inttypes_has_int16=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([uint16_t],[scm_inttypes_has_uint16=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([int32_t],[scm_inttypes_has_int32=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([uint32_t],[scm_inttypes_has_uint32=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([int64_t],[scm_inttypes_has_int64=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([uint64_t],[scm_inttypes_has_uint64=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([intmax_t],[scm_inttypes_has_intmax=1],,[#include <inttypes.h>])
  AC_CHECK_TYPE([uintmax_t],[scm_inttypes_has_uintmax=1],,[#include <inttypes.h>])
fi

# Try hard to find definitions for some required scm_t_*int* types.

### Required type scm_t_int8
if test "$scm_stdint_has_int8"; then
  SCM_I_GSC_T_INT8='"int8_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_int8"; then
  SCM_I_GSC_T_INT8='"int8_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_char" -eq 1; then
  SCM_I_GSC_T_INT8='"signed char"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_int8.])
fi
AC_SUBST([SCM_I_GSC_T_INT8])

### Required type scm_t_uint8
if test "$scm_stdint_has_uint8"; then
  SCM_I_GSC_T_UINT8='"uint8_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_uint8"; then
  SCM_I_GSC_T_UINT8='"uint8_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_unsigned_char" -eq 1; then
  SCM_I_GSC_T_UINT8='"unsigned char"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint8.])
fi
AC_SUBST([SCM_I_GSC_T_UINT8])

### Required type scm_t_int16 (ANSI C says int or short might work)
if test "$scm_stdint_has_int16"; then
  SCM_I_GSC_T_INT16='"int16_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_int16"; then
  SCM_I_GSC_T_INT16='"int16_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_int" -eq 2; then
  SCM_I_GSC_T_INT16='"int"'
elif test "$ac_cv_sizeof_short" -eq 2; then
  SCM_I_GSC_T_INT16='"short"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_int16.])
fi
AC_SUBST([SCM_I_GSC_T_INT16])

### Required type scm_t_uint16 (ANSI C says int or short might work)
if test "$scm_stdint_has_uint16"; then
  SCM_I_GSC_T_UINT16='"uint16_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_uint16"; then
  SCM_I_GSC_T_UINT16='"uint16_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_unsigned_int" -eq 2; then
  SCM_I_GSC_T_UINT16='"unsigned int"'
elif test "$ac_cv_sizeof_unsigned_short" -eq 2; then
  SCM_I_GSC_T_UINT16='"unsigned short"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint16.])
fi
AC_SUBST([SCM_I_GSC_T_UINT16])

### Required type scm_t_int32 (ANSI C says int, short, or long might work)
if test "$scm_stdint_has_int32"; then
  SCM_I_GSC_T_INT32='"int32_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_int32"; then
  SCM_I_GSC_T_INT32='"int32_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_int" -eq 4; then
  SCM_I_GSC_T_INT32='"int"'
elif test "$ac_cv_sizeof_long" -eq 4; then
  SCM_I_GSC_T_INT32='"long"'
elif test "$ac_cv_sizeof_short" -eq 4; then
  SCM_I_GSC_T_INT32='"short"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_int32.])
fi
AC_SUBST([SCM_I_GSC_T_INT32])

### Required type scm_t_uint32 (ANSI C says int, short, or long might work)
if test "$scm_stdint_has_uint32"; then
  SCM_I_GSC_T_UINT32='"uint32_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_uint32"; then
  SCM_I_GSC_T_UINT32='"uint32_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_unsigned_int" -eq 4; then
  SCM_I_GSC_T_UINT32='"unsigned int"'
elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
  SCM_I_GSC_T_UINT32='"unsigned long"'
elif test "$ac_cv_sizeof_unsigned_short" -eq 4; then
  SCM_I_GSC_T_UINT32='"unsigned short"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint32.])
fi
AC_SUBST([SCM_I_GSC_T_UINT32])

### Optional type scm_t_int64 (ANSI C says int, short, or long might work)
### Also try 'long long' and '__int64' if we have it.
SCM_I_GSC_T_INT64=0
if test "$scm_stdint_has_int64"; then
  SCM_I_GSC_T_INT64='"int64_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_int64"; then
  SCM_I_GSC_T_INT64='"int64_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_int" -eq 8; then
  SCM_I_GSC_T_INT64='"int"'
elif test "$ac_cv_sizeof_long" -eq 8; then
  SCM_I_GSC_T_INT64='"long"'
elif test "$ac_cv_sizeof_short" -eq 8; then
  SCM_I_GSC_T_INT64='"short"'
elif test "$ac_cv_sizeof_long_long" -eq 8; then
  SCM_I_GSC_T_INT64='"long long"'
elif test "$ac_cv_sizeof___int64" -eq 8; then
  SCM_I_GSC_T_INT64='"__int64"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_int64.])
fi
AC_SUBST([SCM_I_GSC_T_INT64])

### Optional type scm_t_uint64 (ANSI C says int, short, or long might work)
### Also try 'long long' and '__int64' if we have it.
SCM_I_GSC_T_UINT64=0
if test "$scm_stdint_has_uint64"; then
  SCM_I_GSC_T_UINT64='"uint64_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_uint64"; then
  SCM_I_GSC_T_UINT64='"uint64_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_unsigned_int" -eq 8; then
  SCM_I_GSC_T_UINT64='"unsigned int"'
elif test "$ac_cv_sizeof_unsigned_long" -eq 8; then
  SCM_I_GSC_T_UINT64='"unsigned long"'
elif test "$ac_cv_sizeof_unsigned_short" -eq 8; then
  SCM_I_GSC_T_UINT64='"unsigned short"'
elif test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then
  SCM_I_GSC_T_UINT64='"unsigned long long"'
elif test "$ac_cv_sizeof_unsigned___int64" -eq 8; then
  SCM_I_GSC_T_UINT64='"unsigned __int64"'
else
  AC_MSG_ERROR([Can't find appropriate type for scm_t_uint64.])
fi
AC_SUBST([SCM_I_GSC_T_UINT64])

### Required type scm_t_intmax
###
### We try 'intmax_t', '__int64', 'long long' in this order.  When
### none of them is available, we use 'long'.
###
SCM_I_GSC_T_INTMAX=0
if test "$scm_stdint_has_intmax"; then
  SCM_I_GSC_T_INTMAX='"intmax_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_intmax"; then
  SCM_I_GSC_T_INTMAX='"intmax_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof___int64" -ne 0; then
  SCM_I_GSC_T_INTMAX='"__int64"'
elif test "$ac_cv_sizeof_long_long" -ne 0; then
  SCM_I_GSC_T_INTMAX='"long long"'
else
  SCM_I_GSC_T_INTMAX='"long"'
fi
AC_SUBST([SCM_I_GSC_T_INTMAX])

### Required type scm_t_uintmax
###
### We try 'uintmax_t', 'unsigned __int64', 'unsigned long long' in
### this order.  When none of them is available, we use 'unsigned long'.
###
SCM_I_GSC_T_UINTMAX=0
if test "$scm_stdint_has_uintmax"; then
  SCM_I_GSC_T_UINTMAX='"uintmax_t"'
  SCM_I_GSC_NEEDS_STDINT_H=1
elif test "$scm_inttypes_has_uintmax"; then
  SCM_I_GSC_T_UINTMAX='"uintmax_t"'
  SCM_I_GSC_NEEDS_INTTYPES_H=1
elif test "$ac_cv_sizeof_unsigned___int64" -ne 0; then
  SCM_I_GSC_T_UINTMAX='"unsigned __int64"'
elif test "$ac_cv_sizeof_unsigned_long_long" -ne 0; then
  SCM_I_GSC_T_UINTMAX='"unsigned long long"'
else
  SCM_I_GSC_T_UINTMAX='"unsigned long"'
fi
AC_SUBST([SCM_I_GSC_T_UINTMAX])

AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])

AC_HEADER_STDC
AC_HEADER_TIME
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:
#   complex.h - new in C99
#   fenv.h - available in C99, but not older systems
#   machine/fpu.h - on Tru64 5.1b, the declaration of fesetround(3) is in
#     this file instead of <fenv.h>
#   process.h - mingw specific
#
AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h memory.h process.h string.h \
regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
direct.h strings.h machine/fpu.h])

# "complex double" is new in C99, and "complex" is only a keyword if
# <complex.h> is included
AC_CHECK_TYPES(complex double,,,
[#if HAVE_COMPLEX_H
#include <complex.h>
#endif])

# On MacOS X <sys/socklen.h> contains socklen_t, so must include that
# when testing.
AC_CHECK_TYPE(socklen_t, ,
  [AC_DEFINE_UNQUOTED(socklen_t, int,
                      [Define to `int' if <sys/socket.h> does not define.])],
  [#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/socket.h>
])
AC_CHECK_TYPE(struct ip_mreq)

GUILE_HEADER_LIBC_WITH_UNISTD

AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
AC_TYPE_MODE_T

# On mingw -lm is empty, so this test is unnecessary, but it's
# harmless so we don't hard-code to suppress it.
#
AC_CHECK_LIB(m, cos)

AC_CHECK_FUNCS(gethostbyname)
if test $ac_cv_func_gethostbyname = no; then
    AC_CHECK_LIB(nsl, gethostbyname)
fi

AC_CHECK_FUNCS(connect)
if test $ac_cv_func_connect = no; then
    AC_CHECK_LIB(socket, connect)
fi

dnl
dnl Check for Winsock and other functionality on Win32 (*not* CygWin)
dnl
EXTRA_DEFS=""
case $host in
  *-*-mingw*)
    AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1,
      [Define if you have the <winsock2.h> header file.])])
    AC_CHECK_LIB(ws2_32, main)
    AC_LIBOBJ([win32-uname])
    AC_LIBOBJ([win32-dirent])
    if test "$enable_networking" = yes ; then
      AC_LIBOBJ([win32-socket])
    fi
    if test "$enable_shared" = yes ; then
      EXTRA_DEFS="-DSCM_IMPORT"
      AC_DEFINE(USE_DLL_IMPORT, 1,
        [Define if you need additional CPP macros on Win32 platforms.])
    fi
    ;;
esac
AC_SUBST(EXTRA_DEFS)

# Reasons for testing:
#   crt_externs.h - Darwin specific
#
AC_CHECK_HEADERS([assert.h crt_externs.h])

# Reasons for testing:
#   DINFINITY - OSF specific
#   DQNAN - OSF specific
#       (DINFINITY and DQNAN are actually global variables, not functions)
#   chsize - an MS-DOS-ism, found in mingw
#   cexp, clog - not in various pre-c99 systems, and note that it's possible
#       for gcc to provide the "complex double" type but the system to not
#       have functions like cexp and clog
#   clog10 - not in mingw (though others like clog and csqrt are)
#   fesetround - available in C99, but not older systems
#   ftruncate - posix, but probably not older systems (current mingw
#               has it as an inline for chsize)
#   ioctl - not in mingw.
#   gmtime_r - recent posix, not on old systems
#   pipe - not in mingw
#   _pipe - specific to mingw, taking 3 args
#   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
#   sysconf - not on old systems
#   truncate - not in mingw
#   isblank - available as a GNU extension or in C99
#   _NSGetEnviron - Darwin specific
#
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 strncasecmp])

# Reasons for testing:
#   netdb.h - not in mingw
#   sys/param.h - not in mingw
#   pthread.h - only available with pthreads.  ACX_PTHREAD doesn't
#       check this specifically, we need it for the timespec test below.
#   sethostname - the function itself check because it's not in mingw,
#       the DECL is checked because Solaris 10 doens't have in any header
#   strncasecmp - on NetBSD 1.6 the symbol is available in libc but the
#       declaration cannot be found
#   unsetenv - on Tru64 5.1b the symbol is available in libc but the
#       declaration is only found if `_BSD' is defined; it's marked as
#       discouraged in <stdlib.h> and has type `void' instead of `int'
#       anyway.
#   hstrerror - on Tru64 5.1b the symbol is available in libc but the
#       declaration isn't anywhere.
#   cuserid - on Tru64 5.1b the declaration is documented to be available
#       only with `_XOPEN_SOURCE' or some such.
#   flock - on Tru64 5.1b the declaration is available from <sys/fcntl.h>
#       but only if `_BSD' is defined.
#   vsnprintf - on AIX 5.3, the declaration is only visible with
#       `_XOPEN_SOURCE >= 500' or `_ISOC99_SOURCE'.
#
AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h)
AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv, hstrerror, cuserid, flock, vsnprintf])

# crypt() may or may not be available, for instance in some countries there
# are restrictions on cryptography.
#
# crypt() might be in libc (eg. OpenBSD), or it might be in a separate
# -lcrypt library (eg. Debian GNU/Linux).
#
# On HP-UX 11, crypt() is in libc and there's a dummy libcrypt.a.  We must
# be careful to avoid -lcrypt in this case, since libtool will see there's
# only a static libcrypt and decide to build only a static libguile.
#
# AC_SEARCH_LIBS lets us add -lcrypt to LIBS only if crypt() is not in the
# libraries already in that list.
#
AC_SEARCH_LIBS(crypt, crypt,
  [AC_DEFINE(HAVE_CRYPT,1,
             [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
# csqrt(-i) returned a negative real part, when it should be positive
# for the principal root.
#
if test "$ac_cv_type_complex_double" = yes; then
  AC_CACHE_CHECK([whether csqrt is usable],
    guile_cv_use_csqrt,
    [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <complex.h>
/* "volatile" is meant to prevent gcc from calculating the sqrt as a
   constant, we want to test libc. */
volatile complex double z = - _Complex_I;
int
main (void)
{
  z = csqrt (z);
  if (creal (z) > 0.0)
    return 0;  /* good */
  else
    return 1;  /* bad */
}]])],
    [guile_cv_use_csqrt=yes],
    [guile_cv_use_csqrt="no, glibc 2.3 bug"],
    [guile_cv_use_csqrt="yes, hopefully (cross-compiling)"])])
  case $guile_cv_use_csqrt in
    yes*)
      AC_DEFINE(HAVE_USABLE_CSQRT, 1, [Define to 1 if csqrt is bug-free])
      ;;
  esac
fi

dnl GMP tests
AC_CHECK_LIB([gmp], [__gmpz_init], ,
  [AC_MSG_ERROR([GNU MP not found, see README])])

# mpz_import is a macro so we need to include <gmp.h>
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gmp.h>]],
 			        [[mpz_import (0, 0, 0, 0, 0, 0, 0); ]])],
  [],
  [AC_MSG_ERROR([At least GNU MP 4.1 is required, see README])])

dnl i18n tests
#AC_CHECK_HEADERS([libintl.h])
#AC_CHECK_FUNCS(gettext)
#if test $ac_cv_func_gettext = no; then
#   AC_CHECK_LIB(intl, gettext)
#fi
#AC_CHECK_FUNCS([bindtextdomain textdomain])
AM_GNU_GETTEXT([external], [need-ngettext])

### Some systems don't declare some functions.  On such systems, we
### need to at least provide our own K&R-style declarations.

### GUILE_FUNC_DECLARED(function, headerfile)

### Check for a declaration of FUNCTION in HEADERFILE; if it is
### not there, #define MISSING_FUNCTION_DECL.
AC_DEFUN([GUILE_FUNC_DECLARED], [
  AC_CACHE_CHECK(for $1 declaration, guile_cv_func_$1_declared,
    AC_EGREP_HEADER($1, $2,
		    guile_cv_func_$1_declared=yes,
		    guile_cv_func_$1_declared=no))
  if test [x$guile_cv_func_]$1[_declared] = xno; then
    AC_DEFINE([MISSING_]translit($1, [a-z], [A-Z])[_DECL], 1,
      [Define if the operating system supplies $1 without declaring it.])
  fi
])

GUILE_FUNC_DECLARED(sleep, unistd.h)
GUILE_FUNC_DECLARED(usleep, unistd.h)

AC_CHECK_DECLS([strptime],,,
[#define _GNU_SOURCE /* ask glibc to give strptime prototype */
#include <time.h>])

### On some systems usleep has no return value.  If it does have one,
### we'd like to return it; otherwise, we'll fake it.
AC_CACHE_CHECK([return type of usleep], guile_cv_func_usleep_return_type,
  [AC_EGREP_HEADER(changequote(<, >)<void[ 	]+usleep>changequote([, ]),
                   unistd.h,
		   [guile_cv_func_usleep_return_type=void],
		   [guile_cv_func_usleep_return_type=int])])
case "$guile_cv_func_usleep_return_type" in
  "void" )
    AC_DEFINE(USLEEP_RETURNS_VOID, 1,
      [Define if the system headers declare usleep to return void.])
  ;;
esac

AC_CHECK_HEADER(sys/un.h, have_sys_un_h=1)
if test -n "$have_sys_un_h" ; then
  AC_DEFINE(HAVE_UNIX_DOMAIN_SOCKETS, 1,
    [Define if the system supports Unix-domain (file-domain) sockets.])
fi

AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset)

AC_CHECK_FUNCS(sethostent   gethostent   endhostent   dnl
               setnetent    getnetent    endnetent    dnl
               setprotoent  getprotoent  endprotoent  dnl
               setservent   getservent   endservent   dnl
               getnetbyaddr getnetbyname dnl
	       inet_lnaof inet_makeaddr inet_netof hstrerror dnl
	       inet_pton inet_ntop)

# struct sockaddr field sin_len is only present on BSD systems.
# On 4.4BSD apparently a #define SIN_LEN exists, but on other BSD systems
# (eg. FreeBSD 4.9) it doesn't and we must use this configure check
AC_CHECK_MEMBERS([struct sockaddr.sin_len],,,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>])

AC_MSG_CHECKING(for __libc_stack_end)
AC_CACHE_VAL(guile_cv_have_libc_stack_end,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
extern char *__libc_stack_end;]],
   [[printf("%p", (char*) __libc_stack_end);]])],
   [guile_cv_have_libc_stack_end=yes],
   [guile_cv_have_libc_stack_end=no])])
AC_MSG_RESULT($guile_cv_have_libc_stack_end)

if test $guile_cv_have_libc_stack_end = yes; then
  AC_DEFINE(HAVE_LIBC_STACK_END, 1,
           [Define if you have the __libc_stack_end variable.])
fi

dnl Some systems do not declare this.  Some systems do declare it, as a
dnl macro.  With cygwin it may be in a DLL.

AC_MSG_CHECKING(whether netdb.h declares h_errno)
AC_CACHE_VAL(guile_cv_have_h_errno,
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
                                      [[int a = h_errno;]])],
  [guile_cv_have_h_errno=yes],
  [guile_cv_have_h_errno=no])])
AC_MSG_RESULT($guile_cv_have_h_errno)
if test $guile_cv_have_h_errno = yes; then
  AC_DEFINE(HAVE_H_ERRNO, 1, [Define if h_errno is declared in netdb.h.])
fi

AC_MSG_CHECKING(whether uint32_t is defined)
AC_CACHE_VAL(guile_cv_have_uint32_t,
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
		   #if HAVE_STDINT_H
		   #include <stdint.h>
                   #endif
		   #ifndef HAVE_NETDB_H
	           #include <netdb.h>
		   #endif]],
		   [[uint32_t a;]])],
		   [guile_cv_have_uint32_t=yes],
		   [guile_cv_have_uint32_t=no])])
AC_MSG_RESULT($guile_cv_have_uint32_t)
if test $guile_cv_have_uint32_t = yes; then
  AC_DEFINE(HAVE_UINT32_T, 1,
    [Define if uint32_t typedef is defined when netdb.h is include.])
fi

AC_MSG_CHECKING(for working IPv6 support)
AC_CACHE_VAL(guile_cv_have_ipv6,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>
#include <sys/socket.h>]],
[[struct sockaddr_in6 a;  a.sin6_family = AF_INET6;]])],
[guile_cv_have_ipv6=yes],
[guile_cv_have_ipv6=no])])
AC_MSG_RESULT($guile_cv_have_ipv6)
if test $guile_cv_have_ipv6 = yes; then
  AC_DEFINE(HAVE_IPV6, 1, [Define if you want support for IPv6.])
fi

# 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_CACHE_VAL(guile_cv_have_sin6_scope_id,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>]],
[[struct sockaddr_in6 sok;  sok.sin6_scope_id = 0;]])],
[guile_cv_have_sin6_scope_id=yes],
[guile_cv_have_sin6_scope_id=no])])
AC_MSG_RESULT($guile_cv_have_sin6_scope_id)
if test $guile_cv_have_sin6_scope_id = yes; then
  AC_DEFINE(HAVE_SIN6_SCOPE_ID, 1,
    [Define this if your IPv6 has sin6_scope_id in sockaddr_in6 struct.])
fi

# struct sockaddr_in6 field sin_len is only present on BSD systems
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_len],,,
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <netinet/in.h>])

AC_MSG_CHECKING(whether localtime caches TZ)
AC_CACHE_VAL(guile_cv_localtime_cache,
[if test x$ac_cv_func_tzset = xyes; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
#if STDC_HEADERS
# include <stdlib.h>
#endif
extern char **environ;
unset_TZ ()
{
  char **from, **to;
  for (to = from = environ; (*to = *from); from++)
    if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '='))
      to++;
}
char TZ_GMT0[] = "TZ=GMT0";
char TZ_PST8[] = "TZ=PST8";
main()
{
  time_t now = time ((time_t *) 0);
  int hour_GMT0, hour_unset;
  if (putenv (TZ_GMT0) != 0)
    exit (1);
  hour_GMT0 = localtime (&now)->tm_hour;
  unset_TZ ();
  hour_unset = localtime (&now)->tm_hour;
  if (putenv (TZ_PST8) != 0)
    exit (1);
  if (localtime (&now)->tm_hour == hour_GMT0)
    exit (1);
  unset_TZ ();
  if (localtime (&now)->tm_hour != hour_unset)
    exit (1);
  exit (0);
}]])],
[guile_cv_localtime_cache=no],
[guile_cv_localtime_cache=yes],
[# If we have tzset, assume the worst when cross-compiling.
guile_cv_localtime_cache=yes])
else
        # If we lack tzset, report that localtime does not cache TZ,
        # since we can't invalidate the cache if we don't have tzset.
        guile_cv_localtime_cache=no
fi])dnl
AC_MSG_RESULT($guile_cv_localtime_cache)
if test $guile_cv_localtime_cache = yes; then
  AC_DEFINE(LOCALTIME_CACHE, 1, [Define if localtime caches the TZ setting.])
fi

if test "$enable_regex" = yes; then
   if test "$ac_cv_header_regex_h" = yes ||
      test "$ac_cv_header_rxposix_h" = yes ||
      test "$ac_cv_header_rx_rxposix_h" = yes; then
     GUILE_NAMED_CHECK_FUNC(regcomp, norx, [AC_LIBOBJ([regex-posix])],
     [AC_CHECK_LIB(rx, main)
      GUILE_NAMED_CHECK_FUNC(regcomp, rx, [AC_LIBOBJ([regex-posix])],
     [AC_CHECK_LIB(regex, main)
      GUILE_NAMED_CHECK_FUNC(regcomp, regex, [AC_LIBOBJ([regex-posix])])])]
     )
     dnl The following should not be necessary, but for some reason
     dnl autoheader misses it if we don't include it!
     if test "$ac_cv_func_regcomp_norx" = yes ||
        test "$ac_cv_func_regcomp_regex" = yes ||
        test "$ac_cv_func_regcomp_rx" = yes; then
       AC_DEFINE(HAVE_REGCOMP, 1,
         [This is included as part of a workaround for a autoheader bug.])
     fi
   fi
fi

AC_REPLACE_FUNCS(inet_aton putenv strerror memmove mkstemp)

AC_CHECK_HEADERS(floatingpoint.h ieeefp.h nan.h)

# Reasons for testing:
#   asinh, acosh, atanh, trunc - C99 standard, generally not available on
#                                older systems
#   sincos - GLIBC extension
#
AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)

# C99 specifies isinf and isnan as macros.
# HP-UX provides only macros, no functions.
# glibc 2.3.2 provides both macros and functions.
# IRIX 6.5 and Solaris 8 only provide functions.
#
# The following tests detect isinf and isnan either as functions or as
# macros from <math.h>.  Plain AC_CHECK_FUNCS is insufficient, it doesn't
# use <math.h> so doesn't detect on macro-only systems like HP-UX.
#
AC_MSG_CHECKING([for isinf])
AC_LINK_IFELSE(AC_LANG_SOURCE(
[[#include <math.h>
volatile double x = 0.0;
int main () { return (isinf(x) != 0); }]]),
  [AC_MSG_RESULT([yes])
   AC_DEFINE(HAVE_ISINF, 1,
             [Define to 1 if you have the `isinf' macro or function.])],
  [AC_MSG_RESULT([no])])
AC_MSG_CHECKING([for isnan])
AC_LINK_IFELSE(AC_LANG_SOURCE(
[[#include <math.h>
volatile double x = 0.0;
int main () { return (isnan(x) != 0); }]]),
  [AC_MSG_RESULT([yes])
   AC_DEFINE(HAVE_ISNAN, 1,
             [Define to 1 if you have the `isnan' macro or function.])],
  [AC_MSG_RESULT([no])])

# We must have a proper stack-using alloca in order for stack-copying
# continuations to work properly.  If we don't find a native one,
# abort.

AC_FUNC_ALLOCA
if test "$ALLOCA" = "alloca.o"
then
  AC_ERROR([No native alloca found.])
fi

# Reasons for checking:
#
#     st_rdev
#     st_blksize
#     st_blocks   not in mingw
#     tm_gmtoff   BSD+GNU, not in C99
#
# Note AC_STRUCT_ST_BLOCKS is not used here because we don't want the
# AC_LIBOBJ(fileblocks) replacement which that macro gives.
#
AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks])

AC_STRUCT_TIMEZONE
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,
[#include <time.h>
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif
])
GUILE_STRUCT_UTIMBUF

#--------------------------------------------------------------------
#
# 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
AC_RUN_IFELSE([AC_LANG_SOURCE(
[AC_INCLUDES_DEFAULT
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],
	       [],
	       [AC_MSG_WARN(Guessing that stack grows down -- see scmconfig.h)])

AC_CHECK_SIZEOF(float)
if test "$ac_cv_sizeof_float" -le "$ac_cv_sizeof_long"; then
    AC_DEFINE(SCM_SINGLES, 1,
              [Define this if floats are the same size as longs.])
fi

AC_MSG_CHECKING(for struct linger)
AC_CACHE_VAL(scm_cv_struct_linger,
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>]],
	                  [[struct linger lgr;  lgr.l_linger = 100]])],
			  [scm_cv_struct_linger="yes"],
			  [scm_cv_struct_linger="no"]))
AC_MSG_RESULT($scm_cv_struct_linger)
if test $scm_cv_struct_linger = yes; then
	AC_DEFINE(HAVE_STRUCT_LINGER, 1,
          [Define this if your system defines struct linger, for use with the
           getsockopt and setsockopt system calls.])
fi

# On mingw, struct timespec is in <pthread.h>.
#
AC_MSG_CHECKING(for struct timespec)
AC_CACHE_VAL(scm_cv_struct_timespec,
	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <time.h>
#if HAVE_PTHREAD_H
#include <pthread.h>
#endif]], [[struct timespec t;  t.tv_nsec = 100]])],
          [scm_cv_struct_timespec="yes"],
          [scm_cv_struct_timespec="no"]))
AC_MSG_RESULT($scm_cv_struct_timespec)
if test $scm_cv_struct_timespec = yes; then
  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
    [Define this if your system defines struct timespec via either <time.h> or <pthread.h>.])
fi

#--------------------------------------------------------------------
#
# Flags for thread support
#
#--------------------------------------------------------------------

SCM_I_GSC_USE_PTHREAD_THREADS=0
SCM_I_GSC_USE_NULL_THREADS=0
AC_SUBST([SCM_I_GSC_USE_PTHREAD_THREADS])
AC_SUBST([SCM_I_GSC_USE_NULL_THREADS])

### What thread package has the user asked for?
AC_ARG_WITH(threads, [  --with-threads          thread interface],
            , with_threads=yes)

AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT, 0)
AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER, 0)

case "$with_threads" in
  "yes" | "pthread" | "pthreads" | "pthread-threads" | "")

    build_pthread_support="yes"

    ACX_PTHREAD([CC="$PTHREAD_CC"
       LIBS="$PTHREAD_LIBS $LIBS"
       SCM_I_GSC_USE_PTHREAD_THREADS=1
       with_threads="pthreads"],
      [with_threads="null"
       build_pthread_support="no"])

    old_CFLAGS="$CFLAGS"
    CFLAGS="$PTHREAD_CFLAGS $CFLAGS"

    # Reasons for testing:
    #     pthread_getattr_np - "np" meaning "non portable" says it
    #         all; not present on MacOS X or Solaris 10
    #     pthread_get_stackaddr_np - "np" meaning "non portable" says it
    #         all; specific to MacOS X
    #     pthread_sigmask - not available on mingw
    #
    AC_CHECK_FUNCS(pthread_attr_getstack pthread_getattr_np pthread_get_stackaddr_np pthread_sigmask)

    # On past versions of Solaris, believe 8 through 10 at least, you
    # had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
    # This is contrary to POSIX:
    # http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
    # Check here if this style is required.
    #
    # glibc (2.3.6 at least) works both with or without braces, so the
    # test checks whether it works without.
    #

    if test "$GCC" = "yes"; then
      # Since GCC only issues a warning for missing braces, so we need
      # `-Werror' to catch it.
      CFLAGS="-Werror -Wmissing-braces $CFLAGS"
    fi

    AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
      guile_cv_need_braces_on_pthread_once_init,
      [AC_COMPILE_IFELSE([#include <pthread.h>
         pthread_once_t foo = PTHREAD_ONCE_INIT;],
        [guile_cv_need_braces_on_pthread_once_init=no],
        [guile_cv_need_braces_on_pthread_once_init=yes])])
    if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
      SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
    fi

    # Same problem with `PTHREAD_MUTEX_INITIALIZER', e.g., on IRIX
    # 6.5.30m with GCC 3.3.
    AC_CACHE_CHECK([whether PTHREAD_MUTEX_INITIALIZER needs braces],
      guile_cv_need_braces_on_pthread_mutex_initializer,
      [AC_COMPILE_IFELSE([#include <pthread.h>
         pthread_mutex_t foo = PTHREAD_MUTEX_INITIALIZER;],
        [guile_cv_need_braces_on_pthread_mutex_initializer=no],
        [guile_cv_need_braces_on_pthread_mutex_initializer=yes])])
    if test "$guile_cv_need_braces_on_pthread_mutex_initializer" = yes; then
      SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER=1
    fi

    CFLAGS="$old_CFLAGS"

    # On Solaris, sched_yield lives in -lrt.
    AC_SEARCH_LIBS(sched_yield, rt)

  ;;
esac

case "$with_threads" in
  "pthreads")
  ;;
  "no" | "null")
    SCM_I_GSC_USE_NULL_THREADS=1
    with_threads="null-threads"
  ;;
  * )
    AC_MSG_ERROR(invalid value for --with-threads: $with_threads)
  ;;
esac

AC_MSG_CHECKING(what kind of threads to support)
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

if test "$with_threads" = pthreads; then

AC_MSG_CHECKING(whether pthread_attr_getstack works for the main thread)
old_CFLAGS="$CFLAGS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#if HAVE_PTHREAD_ATTR_GETSTACK
#include <pthread.h>

int main ()
{
  pthread_attr_t attr;
  void *start, *end;
  size_t size;

  pthread_getattr_np (pthread_self (), &attr);
  pthread_attr_getstack (&attr, &start, &size);
  end = (char *)start + size;

  if ((void *)&attr < start || (void *)&attr >= end)
    return 1;
  else
    return 0;
}
#else
int main ()
{
  return 1;
}
#endif
]])],
[works=yes
AC_DEFINE(PTHREAD_ATTR_GETSTACK_WORKS, [1], [Define when pthread_att_get_stack works for the main thread])],
[works=no],
[])
CFLAGS="$old_CFLAGS"
AC_MSG_RESULT($works)

fi # with_threads=pthreads

## Cross building
if test "$cross_compiling" = "yes"; then
  AC_MSG_CHECKING(cc for build)
  ## /usr/bin/cc still uses wrong assembler
  ## CC_FOR_BUILD="${CC_FOR_BUILD-/usr/bincc}"
  CC_FOR_BUILD="${CC_FOR_BUILD-PATH=/usr/bin:$PATH cc}"
else
  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
fi

## AC_MSG_CHECKING("if we are cross compiling")
## AC_MSG_RESULT($cross_compiling)
if test "$cross_compiling" = "yes"; then
   AC_MSG_RESULT($CC_FOR_BUILD)
fi

## No need as yet to be more elaborate
CCLD_FOR_BUILD="$CC_FOR_BUILD"

AC_SUBST(cross_compiling)
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
AC_SUBST(CCLD_FOR_BUILD)

## libtool erroneously calls CC_FOR_BUILD HOST_CC;
## --HOST is the platform that PACKAGE is compiled for.
HOST_CC="$CC_FOR_BUILD"
AC_SUBST(HOST_CC)

if test "$cross_compiling" = "yes"; then
  AC_MSG_CHECKING(guile for build)
  GUILE_FOR_BUILD="${GUILE_FOR_BUILD-guile}"
else
  GUILE_FOR_BUILD='$(preinstguile)'
fi

## AC_MSG_CHECKING("if we are cross compiling")
## AC_MSG_RESULT($cross_compiling)
if test "$cross_compiling" = "yes"; then
   AC_MSG_RESULT($GUILE_FOR_BUILD)
fi
AC_ARG_VAR(GUILE_FOR_BUILD,[guile for build system])
AC_SUBST(GUILE_FOR_BUILD)

## If we're using GCC, ask for aggressive warnings.
case "$GCC" in
  yes )
    ## We had -Wstrict-prototypes in here for a bit, but Guile does too
    ## much stuff with generic function pointers for that to really be
    ## less than exasperating.
    ## -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).
    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
    # Do this here so we don't screw up any of the tests above that might
    # not be "warning free"
    if test "${GUILE_ERROR_ON_WARNING}" = yes
    then
	CFLAGS="${CFLAGS} -Werror"
	enable_compile_warnings=no
    fi
    ;;
esac

## 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
## given in LIBOBJS.  We'll call it LIBLOBJS.
LIBLOBJS="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`"

## We also need to create corresponding .doc and .x files
EXTRA_DOT_DOC_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.doc ,g;s,\.[[^.]]*$,.doc,'`"
EXTRA_DOT_X_FILES="`echo ${LIB@&t@OBJS} | sed 's,\.[[^.]]* ,.x ,g;s,\.[[^.]]*$,.x,'`"

AC_SUBST(GUILE_MAJOR_VERSION)
AC_SUBST(GUILE_MINOR_VERSION)
AC_SUBST(GUILE_MICRO_VERSION)
AC_SUBST(GUILE_EFFECTIVE_VERSION)
AC_SUBST(GUILE_VERSION)

#######################################################################
# library versioning

AC_SUBST(LIBGUILE_INTERFACE_CURRENT)
AC_SUBST(LIBGUILE_INTERFACE_REVISION)
AC_SUBST(LIBGUILE_INTERFACE_AGE)
AC_SUBST(LIBGUILE_INTERFACE)

AC_SUBST(LIBGUILE_SRFI_SRFI_1_MAJOR)
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)

AC_SUBST(LIBGUILE_SRFI_SRFI_4_MAJOR)
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_CURRENT)
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_REVISION)
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE_AGE)
AC_SUBST(LIBGUILE_SRFI_SRFI_4_INTERFACE)

AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_MAJOR)
AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_CURRENT)
AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_REVISION)
AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE_AGE)
AC_SUBST(LIBGUILE_SRFI_SRFI_13_14_INTERFACE)

AC_SUBST(LIBGUILE_SRFI_SRFI_60_MAJOR)
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_CURRENT)
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_REVISION)
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_AGE)
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE)

#######################################################################

dnl Tell guile-config what flags guile users should compile and link with.
GUILE_LIBS="$LDFLAGS $LIBS"
GUILE_CFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_CFLAGS)

AC_SUBST(AWK)
AC_SUBST(LIBLOBJS)
AC_SUBST(EXTRA_DOT_DOC_FILES)
AC_SUBST(EXTRA_DOT_X_FILES)

dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL
top_builddir_absolute=`pwd`
AC_SUBST(top_builddir_absolute)
top_srcdir_absolute=`(cd $srcdir && pwd)`
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.
AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST])
AC_SUBST([SCM_I_GSC_ENABLE_DISCOURAGED])
AC_SUBST([SCM_I_GSC_ENABLE_DEPRECATED])
AC_SUBST([SCM_I_GSC_ENABLE_ELISP])
AC_SUBST([SCM_I_GSC_STACK_GROWS_UP])
AC_SUBST([SCM_I_GSC_C_INLINE])
AC_CONFIG_FILES([libguile/gen-scmconfig.h])

AC_CONFIG_FILES([
  Makefile
  am/Makefile
  benchmark-suite/Makefile
  doc/Makefile
  doc/goops/Makefile
  doc/r5rs/Makefile
  doc/ref/Makefile
  doc/tutorial/Makefile
  emacs/Makefile
  examples/Makefile
  guile-config/Makefile
  ice-9/Makefile
  lang/Makefile
  libguile/Makefile
  oop/Makefile
  oop/goops/Makefile
  scripts/Makefile
  srfi/Makefile
  test-suite/Makefile
  test-suite/standalone/Makefile
])

AC_CONFIG_FILES([guile-1.8.pc])
AC_CONFIG_FILES([check-guile], [chmod +x check-guile])
AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile])
AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools])
AC_CONFIG_FILES([pre-inst-guile], [chmod +x pre-inst-guile])
AC_CONFIG_FILES([pre-inst-guile-env], [chmod +x pre-inst-guile-env])
AC_CONFIG_FILES([libguile/guile-snarf],
                [chmod +x libguile/guile-snarf])
AC_CONFIG_FILES([libguile/guile-doc-snarf],
                [chmod +x libguile/guile-doc-snarf])
AC_CONFIG_FILES([libguile/guile-func-name-check],
                [chmod +x libguile/guile-func-name-check])
AC_CONFIG_FILES([libguile/guile-snarf-docs],
                [chmod +x libguile/guile-snarf-docs])
AC_CONFIG_FILES([test-suite/standalone/test-use-srfi],
                [chmod +x test-suite/standalone/test-use-srfi])
AC_CONFIG_FILES([test-suite/standalone/test-fast-slot-ref],
                [chmod +x test-suite/standalone/test-fast-slot-ref])

AC_OUTPUT

dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl End:


code:
Known Guile documentation bugs                -*- outline -*-

* The building of HTML docs is dependent on GNU Make

This is because the Makefile.am's for the Guile reference manual and
tutorial use a $(shell ...) command to list the set of HTML files to
install.

Probably this will not be fixed until Automake gains proper HTML doc
support.  On the other hand, if we've overlooked a more
version-independent way of achieving the same thing, please let us
know.

path: doc/BUGS

license: unknown


code:
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>

	* .cvsignore: add stamp-vti.1

2002-08-24  Marius Vollmer  <mvo@zagadka.ping.de>

	* Makefile.am (EXTRA_DIST): Do not distribute guile-api.alist, it
	can't be built currently.

2002-05-13  Thien-Thi Nguyen  <ttn@giblet.glug.org>

	* Makefile.am (EXTRA_DIST): New var.

2002-05-11  Thien-Thi Nguyen  <ttn@giblet.glug.org>

	* Makefile.am: Include ../am/maintainer-dirs (in MAINTAINER_MODE).
	(guile-api.alist, guile-api.alist-FORCE):
	New rules (in MAINTAINER_MODE).

2002-05-09  Thien-Thi Nguyen  <ttn@giblet.glug.org>

	* groupings.alist: Add copyright and commentary.

	(favorite): Delete this example composite.
	(embedded-libltdl, gdb, coop, gh, g-fdes, r-fdes, scm, k, POSIX,
	guile-C-API): New groups.

2002-05-08  Thien-Thi Nguyen  <ttn@giblet.glug.org>

	* groupings.alist: New file.

2002-04-23  Thien-Thi Nguyen  <ttn@giblet.glug.org>

	* guile-api.alist: Update.

2002-04-16  Marius Vollmer  <mvo@zagadka.ping.de>

	* Makefile.am (dist-hook): Simplified to not use "cd"; now it
	works for relative pathnames in $(distdir).

2002-04-10  Rob Browning  <rlb@defaultvalue.org>

	* .cvsignore: add version-tutorial.texi, version.texi, and
	stamp-vti1.

2002-03-01  Thien-Thi Nguyen  <ttn@giblet.glug.org>

	* guile-api.alist: Update.

2001-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	* mltext.texi (Guile Character Properties): Fix `hexidecimal'
	spelling errors (merge from stable branch).

	* AUTHORS: Removed.  Authorship information for each manual is now
	in the top-level Texinfo file for that manual.

2001-08-24  Neil Jerram  <neil@ossau.uklinux.net>

	* Makefile.am: Split documentation into per-manual subdirectories.

2001-08-22  Mikael Djurfeldt  <mdj@linnaeus.mit.edu>

	* scheme-options.texi (Evaluator trap options): Splitted
	section "Evaluator options".

	* scheme-evaluation.texi (Evaluator Behaviour): Typo "reader
	options" --> "evaluator options".

2001-08-17  Rob Browning  <rlb@defaultvalue.org>

	* Makefile.am (guile_tut_TEXINFOS): remove guile-tut.texi.  It's
	already in info_TEXINFOS.

	* .cvsignore: rename stamp-vti1 to stamp-vti.1.  Of course this
	only matters once you fix the bug in automake.

2001-08-02  Neil Jerram  <neil@ossau.uklinux.net>

	* scheme-debug.texi (Debugging): Improve `make-stack' doc by
	explaining cutting args.

2001-07-19  Rob Browning  <rlb@defaultvalue.org>

	* posix.texi (Signals): add docs for setitimer and getitimer.

2001-07-11  Gary Houston  <ghouston@arglist.com>

	* scheme-evaluation.texi: Added `load-from-path'.  Corrected `load':
	it doesn't use the load paths.

2001-07-04  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Hook Reference): Removed documentation for
	`make-hook-with-name', which does note exist.  Added note about
	unspecified return values to all procedure documentation

2001-07-02  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-modules.texi (SRFI-1 Fold and Map): Documented extended
	versions of `map' and `for-each'.

2001-06-30  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* preface.texi (Manual Conventions): Added description of
	@result{} and @print{}.

	* scheme-data.texi (Hash Table Examples): New subsubsection.

2001-06-30  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Hash Tables): Added docs for
	`make-hash-table'.

2001-06-29  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* misc-modules.texi: New file.
	(Pretty Printing): New chapter.
	(Formatted Output): New chapter.

	* Makefile.am (guile_TEXINFOS): Added misc-modules.texi.

	* guile.texi (Top): Added inclusion of misc-modules.texi.

	* scheme-modules.texi (Included Guile Modules): Added (srfi
	srfi-4) and (ice-9 rw) modules.
	(Module System Quirks): Removed note that `module-export!' must be
	called via gh_eval_str, now that we have scm_c_export.

	* repl-modules.texi (Loading Readline Support, Readline Options):
	New nodes.

2001-06-27  Neil Jerram  <neil@ossau.uklinux.net>

	* posix.texi (Network Sockets and Communication): Grammar fix -
	thanks to Christopher Cramer!

2001-06-27  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-modules.texi (SRFI-4): Added documentation for the new
	module (srfi srfi-4).

2001-06-26  Neil Jerram  <neil@ossau.uklinux.net>

	* gh.texi (scm transition summary): Refer to scm_mem2string
	instead of scm_makfromstr.

2001-06-26  Dirk Herrmann  <D.Herrmann@tu-bs.de>

	* oldfmt.c (scm_oldfmt):  Use scm_mem2string instead of
	scm_makfromstr.

2001-06-25  Neil Jerram  <neil@ossau.uklinux.net>

	* gh.texi (GH deprecation): Remove paragraph about portability.

	* extend.texi (Libguile Intro): Updated following Marius'
	suggestions.

2001-06-25  Marius Vollmer  <mvo@zagadka.ping.de>

	* Makefile.am (version.texi, version-tutorial.texi): Removed
	kluges to build them unconditionally.

2001-06-22  Neil Jerram  <neil@ossau.uklinux.net>

	* gh.texi (scm transition summary): New node for summary of how to
	transition from GH to scm interface.
	(GH): Link to new node.
	(Calling Scheme procedures from C): Remove doc for gh_set_car and
	gh_set_cdr, which don't actually exist.
	(Data types and constants defined by gh): Correct
	SCM_UNSPECIFIED/SCM_UNDEFINED confusion.
	(Calling Scheme procedures from C): Correct SCM_EOL/SCM_UNDEFINED
	confusion.

2001-06-20  Neil Jerram  <neil@ossau.uklinux.net>

	* guile.texi (Top): Move GH chapter to end of Part V.

	* extend.texi (Libguile Intro), gh.texi (GH deprecation): Explain
	deprecation of GH and broad plan for documentation of scm
	interface.

2001-06-18  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-modules.texi (SRFI-1): Completed procedure documentation.

	* scheme-data.texi (List Constructors): Added make-list.
	Added type index entries for all data types.

2001-06-15  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-modules.texi (SRFI-1): New section documenting the SRFI-1
	module.

2001-06-14  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-modules.texi (Included Guile Modules): Added reference to
	(srfi srfi-1) module.

2001-06-16  Marius Vollmer  <mvo@zagadka.ping.de>

	* posix.texi (Conventions): Use `system-error-errno' instead of
	explicit code

2001-06-04  Gary Houston  <ghouston@arglist.com>

	* scheme-io.texi (Block Reading and Writing): added
	write-string/partial, updated read-string!/partial.

2001-05-30  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* General: A lot of typo, texinfo markup and layout corrections.

	* scheme-data.texi (Arithmetic): Clarified docs for - and /.
	(String Modification): Removed docs for C functions
	(scm_substring_move_right_x etc.)
	(Keyword Procedures): New section documenting the keyword
	procedures from boot-9.scm.
	(Vectors): Moved the section before the non-standard data types.

	* data-rep.texi (Defining New Types (Smobs)): Adapted description
	of smobs and proocedure creation to new terminology.
	(Describing a New Type): Removed mentioning of
	scm_make_smob_type_mfpe from smob function list and added
	deprecation notice for this function.
	(Creating Instances): Added description and macro docs for smobs
	with 2 or 3 data cells.
	(Garbage Collecting Smobs): Removed old docs for SCM_GCTYP16.
	(Garbage Collecting Simple Smobs): Added some clarification about
	usage and usefulness.
	(Non-immediate Datatypes): Changed R4RS reference to R5RS.
	(Vector Data): Document type-specific accessors.

2001-05-23  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* guile.texi: Commented out menu entry and inclusion of Tcl/Tk
	stuff.

	* indices.texi: Users are advised to look under C and Scheme
	names, xref to transformation rules added.

	* intro.texi, scheme-modules.texi, scheme-ideas.texi,
	scheme-evaluation.texi, scheme-data.texi, scheme-procedures.texi:
	Fixed most REFFIXMEs.

	* srfi-modules.texi (About SRFI Usage): New node.
	(SRFI-0): Extended.
	Fixed all REFFIXMEs.

2001-05-19  Neil Jerram  <neil@ossau.uklinux.net>

	* posix.texi (Networking): Split existing material into new nodes
	`Network Address Conversion' and `Network Databases'.

	* scheme-control.texi (Lazy Catch): Update doc for new constraint
	that lazy-catch handlers are not allowed to return.

2001-05-16  Rob Browning  <rlb@cs.utexas.edu>

	* scheme-options.texi (Install Config): fixed minor-version docs
	and added micro-version docs.

2001-05-16  Neil Jerram  <neil@ossau.uklinux.net>

	* data-rep.texi, srfi-modules.texi (SRFI-14 Iterating Over
	Character Sets), scheme-io.texi (Block Reading and Writing),
	scheme-control.texi (Lazy Catch), scheme-procedures.texi (Internal
	Macros): Add @bullet to @itemize usages.  (Thanks for Masao
	Uebayashi for the bug report!)

2001-05-15  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scripts.texi (Invoking Guile): Added docs for --use-srfi.

	* expect.texi, repl-modules.texi: Start the chapters with a new
	page.

	* srfi-modules.texi (SRFI-0): Added note about supported feature
	identifiers and an example.  Start the chapter with a new page.

	* srfi-modules.texi, scheme-data.texi, scheme-control.texi,
	scheme-binding.texi, repl-modules.texi, posix.texi, intro.texi,
	scheme-utility.texi: Change `--' to `-' throughout.

2001-05-14  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-13-14.texi: Removed.

	* srfi-modules.texi (SRFI-13): Merged SRFI-13 docs into SRFI
	chapter.
	(SRFI-14): Merged SRFI-14 too.

	* guile.texi (Top): Remove inclusion of obsolete SRFI-13/14 file.

	* srfi-modules.texi (SRFI-0): New section.
	(SRFI-16): New section.

	Change `--' to `-' throughout.

2001-05-13  Thien-Thi Nguyen  <ttn@revel.glug.org>

	* intro.texi, scheme-modules.texi, scheme-procedures.texi:
	Fixup some module-related references.

	* scheme-modules.texi (Modules): Remove "babbling" fixme.
	(The Guile module system): Rewrite intro.
	(General Information about Modules): Rewrite some parts.
	Move problems to "Module System Quirks".
	(Using Guile Modules): Renamed from "Loading Guile Modules".
	Rewrite most parts.
	Remove reivewme comment.
	(Creating Guile Modules): Review, touch up.
	Remove "Tkintr" comment.
	(Module System Quirks): New node/subsection.

2001-05-06  Thien-Thi Nguyen  <ttn@revel.glug.org>

	* intro.texi (Using Guile Modules): Review; remove reviewme
	comment.  Expand `GUILE_LOAD_PATH' blurb; add small example.
	(Reporting Bugs): Review; remove reviewme comment.
	Reword some phrases; add texi markup.
	Add suggestion to include `guile-config info' output.
	Update gdb invocation; add fixme question.

2001-05-05  Neil Jerram  <neil@ossau.uklinux.net>

	* AUTHORS: Added Martin Grabmueller.

	* scheme-procedures.texi (Macros, Syntax Rules, Internal Macros):
	New material.
	(Syntax Case): New node, but currently empty.

	* scheme-data.texi (Booleans, Symbols): Supply cross-references.

2001-05-04  Neil Jerram  <neil@ossau.uklinux.net>

	* new-docstrings.texi, posix.texi, scheme-control.texi,
	scheme-data.texi, scheme-debug.texi, scheme-evaluation.texi,
	scheme-io.texi, scheme-memory.texi, scheme-procedures.texi:
	Automatic docstring updates (mostly argument name updates and
	blank lines).

	* scheme-modules.texi: Change double hyphens to single.

	* scheme-control.texi (Lazy Catch): Completed.

	* posix.texi (Network Databases and Address Conversion): New
	subsubsection `IPv6 Address Conversion'.

2001-05-04  Thien-Thi Nguyen  <ttn@revel.glug.org>

	* preface.texi (iff): Use proper texi markup.
	Thanks to Florian Weimer.

2001-05-04  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-io.texi (Block Reading and Writing): Moved the
	documentation for read-string!/partial from the node `Reading'.

	* scheme-data.texi (List/String Conversion): Added docstring for
	`string-split'.

2001-05-02  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-13-14.texi: Added @bullet to various @itemize lists.

	* srfi-modules.texi (SRFI Support): New file and chapter.

	* Makefile.am (guile_TEXINFOS): Added repl-modules.texi and
	srfi-modules.texi.

	* guile.texi (Top): New menu entries for the new chapters.
	(Top): @includes for the new chapters.
	(Top): New menu entry for `SRFI Support', @include for
	`srfi-modules.texi'.

	* repl-modules.texi: New file.
	(Readline Support): New chapter for (ice-9 readline).
	(Value History): New chapter for (ice-9 history).

2001-05-02  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-modules.texi (Dynamic Libraries): Renamed from `Dynamic
	Linking from Marius''.
	(The Guile module system): Removed obsolete naming convention.
	(Loading Guile Modules, Creating Guile Modules),
	(More Module Procedures, Included Guile Modules): New nodes, split
	from `The Guile module system'.
	(The Guile module system): Changed references to (ice-9 slib) to
	(ice-9 popen), because note everybody has SLIB installed.
	(Included Guile Modules): Added a bunch of modules shipped with
	Guile.

	(Dynamic Libraries): (old version) Removed.

	* scheme-io.texi (Block Reading and Writing): Corrected
	capitalization, so it builds again.

2001-05-01  Gary Houston  <ghouston@arglist.com>

	* scheme-io.texi: Removed obsolete section Binary IO.  Added
	new section Block Reading and Writing.  Updated section
	Line/Delimited with module usage.

2001-04-29  Neil Jerram  <neil@ossau.uklinux.net>

	* deprecated.texi (Tags): Removed - deprecation expired.

	* scheme-io.texi (Random Access): Removed `fseek' - deprecation
	expired.

	* guile.texi (Top): Add menu entry for Manual Conventions node.

2001-04-28  Neil Jerram  <neil@ossau.uklinux.net>

	* THANKS: Move authorship bit into AUTHORS, simplify structure,
	add Dirk Herrmann.

	* AUTHORS, guile.texi, guile-tut.texi, goops.texi, Makefile.am:
	Consolidate authorship information in AUTHORS file, and @include
	AUTHORS from the top level source file for each manual.

2001-04-28  Thien-Thi Nguyen  <ttn@revel.glug.org>

	* preface.texi (Manual Conventions): New chapter.

2001-04-26  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* srfi-13-14.texi (Reverse/Append): Updated procedure names for
	string-concatenate-reverse[/shared].
	(Reverse/Append): Document the parameter `end' to
	string-concatenate-reverse.

2001-04-26  Neil Jerram  <neil@ossau.uklinux.net>

	* data-rep.texi (Defining New Types (Smobs)): Use non-deprecated
	smob interface.  Thanks to Masao Uebayashi for the patch!
	(Creating Instances): Don't need SCM_NIMP anymore.

2001-04-25  Marius Vollmer  <mvo@zagadka.ping.de>

	* guile.1: New file, from Robert Merkel and Rob Browning.
	* Makefile.am (man_MANS, EXTRADIST): Added, but still commented
	out: install and distribute the manpage.  It is not yet installed
	or distributed since we don't have Robert's papers yet.

2001-04-24  Neil Jerram  <neil@ossau.uklinux.net>

	* guile-tut.texi: Include version-tutorial.texi rather than
	version.texi.

	* Makefile.am ($(srcdir)/version-tutorial.texi): New target, to
	avoid having two files both include version.texi.

2001-04-24  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* Makefile.am (guile_TEXINFOS): Added srfi-13-14.texi.

	* srfi-13-14.texi: New file documenting SRFI-13/14.

	* guile.texi (Top): Added the SRFI-13/14 menu entry and @include.

2001-04-22  Neil Jerram  <neil@ossau.uklinux.net>

	* posix.texi (Network Sockets and Communication): Automatic
	docstring updates for `socket' and `connect'.  (For IPV6 support.)

	* scheme-io.texi: Remove old docstring comments referring to
	r4rs.scm.

	* appendices.texi (The Basic Guile Package, Packages not shipped
	with Guile), env.texi (Switching to Environments), format.texi
	(Format Specification), gh.texi
	(Executing Scheme code, Calling Scheme procedures from C),
	guile-tut.texi (How to characterize Guile), scheme-data.texi
	(Symbols, Keywords, Keyword Read Syntax, Append/Reverse),
	scheme-evaluation.texi (Delayed Evaluation), scheme-modules.texi
	(Scheme and modules), scheme-io.texi (Soft Ports): Change R4RS
	references to R5RS.

	* r4rs.texi: Removed.

	* Makefile.am (info_TEXINFOS): Remove r4rs.

	* README: Note removal of r4rs, and provide a reference.

	* scheme-control.texi (Exceptions): Extended documentation.
	(Continuations): Correct "except" typo, and fix reference to
	Exceptions node.  Plus minor review changes.

2001-04-20  Neil Jerram  <neil@ossau.uklinux.net>

	* scheme-control.texi (Exceptions): Reorganized and extended
	existing documentation; more to come.

2001-04-20  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-evaluation.texi (Comments): Document normal comments and
	comment conventions.
	(Block Comments): Documented multiline comments.
	(Case Sensitivity): Documented R5RS and Guile behaviour and how to
	switch it off.

	* scheme-control.texi (Continuations): Added some documentation
	for call/cc.
	(Exceptions): Added xref to `Continuations'.

	* scheme-binding.texi (Binding Reflection): Typo fix.

2001-04-20  Neil Jerram  <neil@ossau.uklinux.net>

	* gh.texi (Executing Scheme code): gh_eval_file returns
	SCM_UNSPECIFIED.  Thanks to Dirk for the report!

	* data-rep.texi (Non-immediate Datatypes, Immediates vs
	Non-immediates): Emphasize current rather than pre-1.4 practice
	when talking about not needing to call SCM_NIMP.

	* recipe-guidelines.txt: New file: guidelines for contributions to
	the Guile Recipes manual.

2001-04-20  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* intro.texi (Using Guile Modules): Wrote intro to using modules.
	(Writing New Modules): New intro for writing modules.
	(Reporting Bugs): Added info about what is a bug and what to
	include in a bug report (taken and adapted from the Emacs
	Reference Manual).

2001-04-19  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-control.texi (while do): Added documentation for named
	let.

	* scheme-binding.texi (Internal Definitions): New explanation of
	`Internal Definitions'.
	(Top Level): Documented behaviour of top level definitions.
	(Binding Constructs): New introductory text.
	(Local Bindings): Explain concept of local bindings.  Document
	let, let* and letrec.

2001-04-18  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-modules.texi (Modules): Added menu descriptions.
	(Scheme and modules, The Guile module system): Some whitespace
	cleanup
	(The Guile module system): Layout fixes, docstring fix for
	`define-module'.

2001-04-17  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-control.texi (Multiple Values): Documented concept of
	multiple values, added docs for `receive'.
	(begin): Documented `begin'.
	(if cond case): Documented `if', `cond' and `case'.
	(and or): Documented `and' and `or'.
	(while do): Documented `do' and `while'.

	* scheme-procedures.texi (Optional Arguments): Split the node,
	added introductory text, added menu for subsections.
	(let-optional Reference, let-keywords Reference),
	(lambda* Reference, define* Reference): Added syntax documentation
	for all exported procedures from (ice-9 optargs).

2001-04-17  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-utility.texi (General Conversion): New node, added
	`object->string'.
	(Equality): Added definition and explanation of `sameness'.

	* posix.texi (System Identification): Added `gethostname' and
	`sethostname'.
	(Processes): Added `setpriority' and `getpriority'.
	(User Information): Added `cuserid' and `getlogin'.
	(Ports and File Descriptors): Added `flock'.
	(Processes): Added `chroot'.
	(File System): Added `mkstemp!'.
	(Encryption): New node, added `crypt' and `getpass'.

	* new-docstrings.texi: Moved several docstrings over to the
	reference manual (see above which).

	* scheme-data.texi (Data Types), (Numerical Tower): Add explicit
	@bullet to @itemize to satisfy older `makeinfo'.

2001-04-16  Neil Jerram  <neil@ossau.uklinux.net>

	* data-rep.texi (Signalling Type Errors):  Update SCM_ASSERT doc
	for recent changes to disallow passing a string parameter as the
	`pos'.  Thanks to Dirk Herrmann for the patch!

2001-04-13  Neil Jerram  <neil@ossau.uklinux.net>

	* data-rep.texi (Unpacking the SCM type): New section, taken from
	Dirk Herrmann's description of SCM and scm_bits_t in api.txt.
	(Immediate Datatypes, Non-immediate Datatypes): Remove obsolete
	notes about needing to call SCM_NIMP.

2001-04-11  Neil Jerram  <neil@ossau.uklinux.net>

	* scheme-procedures.texi (Procedures with Setters):  Fix dvi
	building syntax error.  Thanks to Dale P. Smith for the report and
	patch.

2001-04-11  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-scheduling.texi (Arbiters): New explanatory text.
	(Asyncs): New explanations and documentation.
	(Scheduling): Added menu entry descriptions.
	(Fluids): New documentation.

2001-04-11  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-procedures.texi (Lambda): Documented the lambda form.
	(Procedure Properties): Concept and usage explanation added.
	(Procedures with Setters): Explain by example, introduce
	definitions.

	* scheme-data.texi (Symbols and Variables): Split and reorganized
	this section.
	(Symbols): New introductory text.
	(Characters): Added char-ci* procedures to rn index.

2001-04-10  Neil Jerram  <neil@ossau.uklinux.net>

	* scm.texi (Handling Errors):  Improve Texinfo markup.  Thanks to
	Dale P. Smith for the patch!

	* api.txt (Accessing Cell Entries): Fix typo.

2001-04-09  Neil Jerram  <neil@ossau.uklinux.net>

	* deprecated.texi (Shared And Read Only Strings): New section for
	deprecated string stuff.  I've also updated the text a bit to
	reflect current usage of "read only" strings.

	* scheme-data.texi (Shared Substrings, Read Only Strings): Moved
	to deprecated.texi.

	* deprecated.texi, posix.texi, scheme-binding.texi,
	scheme-control.texi, scheme-data.texi, scheme-debug.texi,
	scheme-evaluation.texi, scheme-io.texi, scheme-memory.texi,
	scheme-modules.texi, scheme-options.texi, scheme-procedures.texi,
	scheme-scheduling.texi, scheme-translation.texi,
	scheme-utility.texi: Remove `@c docstring' comments, since they
	aren't used any more by the docstring tracking utilities.

2001-04-09  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Pairs): New data type and procedure
	description.
	(Lists): Added new subsections for grouping the list procedures.
	(Hooks): Added new nodes for hook subsections.
	(String Syntax): New node, factoring out read syntax.
	(Strings): Some blurb about allowed characters, zero-termination
	etc.
	(Keywords): Added menu descriptions.

2001-04-08  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-indices.texi (R5RS Index): Print index `rn', not `r5'.

	* guile.texi: The index formerly known as `r5' is now called `rn'.

	* scheme-utility.texi, scheme-procedures.texi, scheme-io.texi,
	scheme-evaluation.texi, scheme-control.texi, scheme-data.texi:
	Changed all @r5index entries to @rnindex.

2001-04-06  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Hooks): Added hook description and
	constraints.

2001-04-06  Thien-Thi Nguyen  <ttn@revel.glug.org>

	* scheme-scheduling.texi (Higher level thread
	procedures): Replace some instances of `@var' with `@code'.

	* scheme-scheduling.texi (Higher level thread
	procedures): Rewrite.

2001-04-04  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Alphabetic Case Mapping),
	(String Comparison): Rearranged function order.
	(Vectors): Reorganized, new introductory text, docs about read
	syntax.

2001-04-03  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-options.texi, scheme-procedures.texi,
	scheme-modules.texi, scheme-memory.texi, scheme-control.texi,
	scheme-utility.texi, scheme-io.texi, scheme-evaluation.texi,
	scheme-data.texi: Removed a lot of ARGFIXME's after tweaking
	docstrings and C source.

	* new-docstrings.texi, scheme-io.texi, scheme-data.texi,
	posix.texi, scheme-control.texi, scheme-evaluation.texi,
	scheme-memory.texi, scheme-procedures.texi, scheme-modules.texi,
	scheme-scheduling.texi: Automated docstring merging.

2001-04-02  Neil Jerram  <neil@ossau.uklinux.net>

	* data-rep.texi (Immediates vs. Non-immediates): Update
	out-of-date documentation.  (Thanks to Dirk Herrmann for the
	report!)
	(Immediates vs Non-immediates): Renamed without the dot, since the
	dot causes `info' not to be able to display this node!

	* Makefile.am (guile_TEXINFOS): Add in a few more source files
	that had got left out.

2001-03-30  Neil Jerram  <neil@ossau.uklinux.net>

	* scheme-reading.texi (Further Reading): Add bullets to further
	reading list.

	* gh.texi: Insert page break before chapter.  Remove page breaks
	within the chapter.

	* Makefile.am: Add script-getopt.texi.

	* guile.texi (Top): Include and link to new script-getopt.texi
	chapter.

	* script-getopt.texi: New chapter on command line handling.
	(Written and contributed by Martin Grabmueller, revised by me.)

	* intro.texi (Modules and Extensions): Fix typo.

2001-03-27  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Strings): Reorganized the whole `Strings'
	section and wrote introductory material for each new subsection.

2001-03-25  Marius Vollmer  <mvo@zagadka.ping.de>

	* intro.texi (Modules and Extensions): Some short text about
	dynamic libraries and modules.

2001-03-23  Neil Jerram  <neil@ossau.uklinux.net>

	* intro.texi (Writing Extensions for Guile), scheme-data.texi
	(Lists): Fix typos.

	* guile-tut.texi, ChangeLog-guile-doc-tutorial: Added to CVS.  It
	seems that I somehow missed these out when I moved everything from
	guile-doc to guile-core.

	* posix.texi, scheme-data.texi, scheme-evaluation.texi,
	scheme-io.texi, scheme-memory.texi: Automatic docstring updates.

	* new-docstrings.texi: New file.  Holds snarfed docstrings that
	have not yet been incorporated into the reference manual.

2001-03-20  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-options.texi (Evaluator options): Added evaluator
	options, corrected docs for evaluator trap options.

	* scheme-evaluation.texi (Scheme Read): New docs for read-options,
	read-enable, read-disable and read-set! and cross references to
	option nodes.
	(Evaluator Options): New docs for eval-options, eval-enable,
	eval-disable and eval-set!, traps, trap-enable, trap-disable and
	trap-set! and cross references to option nodes.
	(Evaluator Behaviour): Renamed node from `Evaluator options' to
	avoid name clash.

	* scheme-io.texi (String Ports): Added docs for SRFI-6 procedures.
	(Void Ports): Corrected introductory comment.

2001-03-16  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* scheme-data.texi (Arithmetic): Documented the arithmetic
	procedures.
	(Integer Operations): Added documentation.
	(Comparison): Added documentation.
	(Complex): Added documentation.
	(Symbols and Variables): Comment out `builtin-bindings', which is
	removed according to NEWS.
	(Pairs): Added documentation.

	* scheme-io.texi: Added R5RS index entries for all R5RS
	procedures.
	(File Ports): New docs for `call-with-input-file',
	`call-with-output-file', `with-input-from-file',
	`with-output-to-file', `with-error-to-file'.

	* scheme-control.texi, scheme-utility.texi,
	* scheme-procedures.texi: Added R5RS index entries for all R5RS
	procedures.

	* scheme-evaluation.texi (Fly Evaluation): Added documentation for
	`apply'.  Added R5RS index entries for all R5RS procedures.

	* scheme-data.texi: Added R5RS index entries for all R5RS
	procedures.  Removed R5RS index entries for `ass{q,v,occ}-set!'.
	Removed explicit entries into the function entries.  They are
	automagic.
	(Vectors): Added documentation for `make-vector', `vector-ref' and
	`vector-set!'.

2001-03-12  Marius Vollmer  <mvo@zagadka.ping.de>

	* intro.texi: Changed to reflect current practice better.  Added
	stuff about writing Guile Extensions (aka dynamically loaded
	shared libraries).

2001-03-09  Mikael Djurfeldt  <mdj@linnaeus.mit.edu>

	* goops.texi (VERSION): Bumped to version 0.3.

	* goops-tutorial.texi, goops.texi: Updated to reflect new
	define-method syntax.

2001-03-09  Neil Jerram  <neil@ossau.uklinux.net>

	* Makefile.am: Change HTML to HTMLDOC, now that we're part of a
	wider distribution.

	Moving documentation files from guile-doc and guile-doc into
	guile-core/doc:

	* env.texi, indices.texi, mbapi.texi, mltext.texi, scripts.texi,
	scsh.texi, tcltk.texi, hierarchy.txt, scheme-indices.texi,
	slib.texi, deprecated.texi, scheme-binding.texi, appendices.texi,
	scheme-intro.texi, goops.texi, extend.texi, gh.texi, intro.texi,
	preface.texi, scm.texi, goops-tutorial.texi, hierarchy.eps,
	r4rs.texi, r5rs.texi, texinfo.tex, scheme-reading.texi,
	data-rep.texi, scheme-utility.texi, posix.texi,
	scheme-control.texi, scheme-debug.texi, scheme-evaluation.texi,
	scheme-io.texi, scheme-memory.texi, scheme-modules.texi,
	scheme-options.texi, scheme-procedures.texi,
	scheme-scheduling.texi, scheme-translation.texi, guile.texi,
	scheme-data.texi, scheme-ideas.texi, expect.texi,
	ChangeLog-guile-doc-ref, guile-tut.texi,
	ChangeLog-guile-doc-tutorial, AUTHORS, BUGS, NEWS, THANKS: New
	files.

	* .cvsignore, Makefile.am, README: Merged.

	* sources: New subdirectory.

	Both the following files are about to be replaced by files from
	guile-doc/ref.

	* texinfo.tex: Removed.

	* data-rep.texi: Removed.

2001-02-15  Neil Jerram  <neil@ossau.uklinux.net>

	* README: Explain retirement of `data-rep.texi'.

	* Makefile.am (info_TEXINFOS, data_rep_TEXINFOS): Removed.

	* data-rep.texi: Replace this copy of data-rep.texi with a notice
	indicating that it has been retired.  The master copy of
	data-rep.texi is at guile-doc/ref/data-rep.texi.

2001-02-04  Marius Vollmer  <mvo@zagadka.ping.de>

	* data-rep.texi: Use SCM_SMOB_DATA instead of SCM_CDR.  Also
	things like SCM_SMOB_PREDICATE and SCM_NEWSMOB.  Thanks to Dale
	P. Smith!

2000-10-25  Mikael Djurfeldt  <mdj@linnaeus.mit.edu>

	* mop.text: Preliminary documentation of the GOOPS meta object
	protocol.

2000-07-28  Neil Jerram  <neil@ossau.uklinux.net>

	* data-rep.texi (Garbage Collection): Fix "accomodate" spelling
	mistake.

2000-06-30  Dirk Herrmann  <D.Herrmann@tu-bs.de>

	* data-rep.tex:  Removed documentation for SCM_OUTOFRANGE.

2000-06-20  Mikael Djurfeldt  <mdj@thalamus.nada.kth.se>

	* data-rep.texi: Center discussion around the standard interface
	for smob type creation (scm_make_smob_type) and warn about the
	ongoing discussion which may result in deprecating
	scm_make_smob_type_mfpe in next release of Guile.

2000-05-15  Dirk Herrmann  <D.Herrmann@tu-bs.de>

	* data-rep.texi:  Updated the macro names for operating on
	characters.

2000-03-22  Dirk Herrmann  <D.Herrmann@tu-bs.de>

	* api.txt:  Added a first attempt for a description of the newly
	designed low level API.

2000-01-31  Marius Vollmer  <mvo@zagadka.ping.de>

	* Makefile.am (version.texi): Override automake's rule for
	version.texi so that it gets created even in non-maintainer-mode.

Thu Jan 20 13:00:18 2000  Greg J. Badros  <gjb@cs.washington.edu>

	* version.texi, stamp-vti: Removed -- these are auto-generated.

2000-01-12  Mikael Djurfeldt  <mdj@mdj.nada.kth.se>

	* Makefile.am (dist-hook): Updated to include oldfmt.c in
	distribution archive.

	* README: Updated with note about oldfmt.c.

	* oldfmt.c: New file: Used by application writers to adapt to
	new-style error format strings.

1999-12-06  Gary Houston  <ghouston@freewire.co.uk>

	* data-rep.texi: change dircategory to match change in guile-doc
	and scm.

1999-10-05  Jim Blandy  <jimb@savonarola.red-bean.com>

	* Makefile.in: Deleted from CVS repository.  Run the autogen.sh
	script to create generated files like this one.

1999-09-11  Jim Blandy  <jimb@savonarola.red-bean.com>

	* Makefile.in: Regenerated.

Fri Jun 25 22:21:43 1999  Greg Badros  <gjb@cs.washington.edu>

	* data-rep.texi: Updated SMOB docs to talk about
 	scm_make_smob_type_mfpe, SCM_RETURN_NEWSMOB, SCM_NEWSMOB function
 	and macros.

1999-04-17  Jim Blandy  <jimb@savonarola.red-bean.com>

	* Makefile.in: Regenerated.

1998-10-19  Jim Blandy  <jimb@zwingli.cygnus.com>

	* COPYING: New file.
	* Makefile.in: Regenerated.

	* Makefile.am (EXAMPLE_SMOB_FILES): List example-smob/COPYING.
	* Makefile.in: Regenerated.

1998-10-16  Jim Blandy  <jimb@zwingli.cygnus.com>

	* Makefile.in: Regenerated, after change to qthreads.m4.

1998-10-15  Jim Blandy  <jimb@zwingli.cygnus.com>

	* stamp-vti: Regenerated.

	* hacks.el: Some handy helper functions for working on the manual.

	* data-rep.texi: Extended to accomodate a full running example,
	provided with the manual.
	* example-smob: A new subdirectory, containing example files for
	the manual chapter on smobs.
	* Makefile.am (EXAMPLE_SMOB_FILES, dist-hook): New variable and
	target, to get the example-smob directory into the distribution.
	* Makefile.in: Regenerated.

1998-10-08  Jim Blandy  <jimb@zwingli.cygnus.com>

	* .cvsignore: New file, containing data-rep.info.  I'm not sure
 	whether we want to check this file into CVS, because it's
 	generated; if you find compelling reasons it should be, let me
	know.

1998-10-07  Jim Blandy  <jimb@zwingli.cygnus.com>

	* New directory for documentation.
	* README: New file.
	* data-rep.texi: It's not a real manual, but it's better than
	nothing.
	* Makefile.am, Makefile.in, data-rep.info, data-rep.texi,
 	mdate-sh, stamp-vti, texinfo.tex, version.texi: The usual support
 	files.


code:
2001-02-15  Neil Jerram  <neil@ossau.uklinux.net>

	* sources/data-rep.texi: Removed.  (ref/data-rep.texi is now the
	current version of this essay.)

2001-01-26  Neil Jerram  <neil@ossau.uklinux.net>

	* configure.in: Only check for `texi2html' program if HTML is
	enabled, and explain where to get `texi2html' from if the check
	fails.

	* configure.in, Makefile.am, ref/Makefile.am,
	tutorial/Makefile.am: Clean up Makefile.am's and support
	(configurable) building of HTML documentation in addition to
	Info.  Thanks to Steve Tell for the patch on which these changes
	were based.

2000-10-14  Neil Jerram  <neil@ossau.uklinux.net>

	* sources/data-rep.texi: Merged a lot of changes from
	guile-core/doc/data-rep.texi.

2000-08-07  Neil Jerram  <neil@ossau.uklinux.net>

	* configure.in, configure: Advance version number to 1.4.

2000-07-28  Neil Jerram  <neil@ossau.uklinux.net>

	* sources/data-rep.texi (Garbage Collection): Fix "accomodate"
	spelling mistake.

1998-07-27  Mark Galassi  <rosalia@cygnus.com>

	* simple test

1998-04-13  Marius Vollmer  <mvo@zagadka.ping.de>

	Have "make dist" include the sources directory:
	* Makefile.am: Added "sources" directory to SUBDIRS.
	* sources/Makefile.am: New file.
	* configure.in: Added "sources/Makefile" to AC_OUTPUT.

Sun Jun 22 18:38:28 1997  Tim Pierce  <twp@twp.tezcat.com>

	New documentation module.

path: doc/ChangeLog-guile-doc


code:
## Process this file with Automake to create Makefile.in
##
##  	Copyright (C) 1998, 2002, 2006, 2008 Free Software Foundation, Inc.
##
##   This file is part of GUILE.
##
##   GUILE 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.
##
##   GUILE 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 GUILE; see the file COPYING.  If not, write
##   to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
##   Floor, Boston, MA 02110-1301 USA

AUTOMAKE_OPTIONS = gnu

SUBDIRS = ref tutorial goops r5rs

dist_man1_MANS = guile.1

EXAMPLE_SMOB_FILES = \
    ChangeLog-2008 Makefile README image-type.c image-type.h myguile.c

OLDFMT = oldfmt.c

dist-hook:
	cp $(srcdir)/$(OLDFMT) $(distdir)/
	mkdir $(distdir)/example-smob
	for f in $(EXAMPLE_SMOB_FILES); do \
	  cp $(srcdir)/example-smob/$$f $(distdir)/example-smob/; \
        done

EXTRA_DIST = groupings.alist ChangeLog-2008 # guile-api.alist

include $(top_srcdir)/am/maintainer-dirs
guile-api.alist: guile-api.alist-FORCE
	( cd $(top_builddir) ; $(mscripts)/update-guile-api.alist )
guile-api.alist-FORCE:


code:
Guile-doc NEWS --- history of user-visible changes.  -*- text -*-
Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
See the end for copying conditions.

Changes since Guile 1.3.4:

* It's now possible to build HTML documentation as well as Info

The guile-doc distribution now supports building HTML versions of the
Guile tutorial and reference manual, in addition to the standard Info
documentation.  To enable this, include the `--enable-html' option
when you run `./configure':

     ./configure --enable-html

HTML documentation is installed in $(prefix)/html/guile-$(VERSION).

Changes since Guile 1.0 (Sun 5 Jan 1997):

* The current documentation approach, recommended by Jim Blandy, is to
have: (*) a tutorial with the pedagogical style of guile-user, and a
non-dry reference manual in the style of the most excellent GNU libc
reference manual: the reference manual should be complete, but at the
same time it should have an introductory screen for each major topic,
which can be referenced if the user goes "up" a level in the info
documentation.

Copyright information:

Copyright (C) 1996,1997, 2006 Free Software Foundation, Inc.

   Permission is granted to anyone to make or distribute verbatim copies
   of this document as received, in any medium, provided that the
   copyright notice and this permission notice are preserved,
   thus giving the recipient permission to redistribute in turn.

   Permission is granted to distribute modified versions
   of this document, or of portions of it,
   under the above conditions, provided also that they
   carry prominent notices stating who last changed them.

path: doc/NEWS


code:
This directory contains documentation on the Guile core.         -*-text-*-

The documentation consists of the following manuals.

- The Guile Tutorial (guile-tut.texi) contains a tutorial introduction
  to using Guile.

- The Guile Reference Manual (guile.texi) contains (or is intended to
  contain) reference documentation on all aspects of Guile.

- The GOOPS Manual (goops.texi) contains both tutorial-style and
  reference documentation for using GOOPS, Guile's Object Oriented
  Programming System.

- The Revised^5 Report on the Algorithmic Language Scheme (r5rs.texi).

Please be aware that this is all very much work in progress (apart
from the Revised^5 Report).  Bug reports and contributions are
welcome!

The file `oldfmt.c' contains a function which can be used by
application writers to support both old-style and new-style error
format strings.

The `sources' directory includes some stuff relevant to the Guile
reference manual, and which may eventually be folded in to it.  It's
not immediately relevant, however, which is why it's not in this
directory.

The Revised^4 Report (r4rs.texi) is no longer in this distribution, as
it is completely superseded by the Revised^5 Report.  If you need to
consult R4RS, it is still widely available, for example at
http://www-swiss.ai.mit.edu/projects/info/SchemeDocs/r4rs/.

path: doc/README


code:
Many thanks to the following people for contributing to the Guile
manuals!

Proofreading, bug reports and patches from:
      Chris Bitmead
Christopher Cramer
     Marcus Daniels
       Dirk Herrmann
    Dale P. Smith
      Steve Tell
	Lee Thomas
      Masao Uebayashi
       Joel Weber
      Keith Wright

New entries from:
	Per Bothner
     Martin Grabmueller
  Thien Thi Nguyen

path: doc/THANKS


code:
2008-01-22  Neil Jerram  <neil@ossau.uklinux.net>

	* COPYING: Removed.

2004-09-24  Marius Vollmer  <mvo@zagadka.de>

	* image-type.c: Updated from manual.

2002-02-28  Marius Vollmer  <mvo@zagadka.ping.de>

	* image-type.c (image_tag): Changed type to scm_t_bits.
	(make_image): Use scm_gc_malloc instead of scm_must_malloc.
	(free_image): Use scm_gc_free instead of free.  Return zero.

2001-05-30  Martin Grabmueller  <mgrabmue@cs.tu-berlin.de>

	* image-type.c: Adapted to new typing and naming convention.

2001-04-26  Neil Jerram  <neil@ossau.uklinux.net>

	* image-type.c (make_image): Don't need to use SCM_NIMP before
	SCM_STRINGP.
	(clear_image): Use SCM_SMOB_PREDICATE.
	(clear_image, mark_image, free_image, print_image): Use
	SCM_SMOB_DATA rather than SCM_CDR.

2000-06-20  Mikael Djurfeldt  <mdj@thalamus.nada.kth.se>

	* image-type.c: Removed unused scm_smobfuns structure.
	(init_image_type): Use standard smob type interface.

Fri Jun 25 22:21:04 1999  Greg Badros  <gjb@cs.washington.edu>

	* image-type.c:  Updated example to use scm_make_smob_type_mfpe,
	SCM_RETURN_NEWSMOB, SCM_NEWSMOB function and macros.

1998-10-19  Jim Blandy  <jimb@zwingli.cygnus.com>

	* image-type.c, myguile.c: Terminate copyright comments.

	* COPYING: New file.
	* image-type.c myguile.c: Add copyright notice.

1998-10-16  Jim Blandy  <jimb@zwingli.cygnus.com>

	* Makefile (myguile): Fix link command, to put the Guile libraries
	after the object files.  The old command worked on my machine, but
	I don't see how.

1998-10-15  Jim Blandy  <jimb@zwingli.cygnus.com>

	Created this directory for the Guile 1.3 release.  Thanks to Jay
	Glascoe for suggesting that we provide a complete, buildable
	example!
	* ChangeLog, Makefile, README, image-type.c, image-type.h,
	myguile: New files.


code:
CFLAGS=`guile-config compile`
LIBS=`guile-config link`

O_FILES=image-type.o myguile.o

all: myguile

myguile: $(O_FILES)
	$(CC) $(O_FILES) $(LIBS) -o myguile

clean:
	-rm -rf myguile $(O_FILES)

path: doc/example-smob/Makefile


code:
This is the example code for the ``Defining New Types (Smobs)''
chapter of the Guile manual.

When you try to execute the code, if the system complains that it
can't find libguile.so, you need to add the directory containing the
installed Guile libraries to your LD_LIBRARY_PATH environment variable.

path: doc/example-smob/README


code:
/* image-type.c
 *
 *	Copyright (C) 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this software; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 */

#include <stdlib.h>
#include <libguile.h>

static scm_t_bits image_tag;

struct image {
  int width, height;
  char *pixels;

  /* The name of this image */
  SCM name;

  /* A function to call when this image is
     modified, e.g., to update the screen,
     or SCM_BOOL_F if no action necessary */
  SCM update_func;
};

static SCM
make_image (SCM name, SCM s_width, SCM s_height)
{
  SCM smob;
  struct image *image;
  int width = scm_to_int (s_width);
  int height = scm_to_int (s_height);

  /* Step 1: Allocate the memory block.
   */
  image = (struct image *) scm_gc_malloc (sizeof (struct image), "image");

  /* Step 2: Initialize it with straight code.
   */
  image->width = width;
  image->height = height;
  image->pixels = NULL;
  image->name = SCM_BOOL_F;
  image->update_func = SCM_BOOL_F;

  /* Step 3: Create the smob.
   */
  SCM_NEWSMOB (smob, image_tag, image);

  /* Step 4: Finish the initialization.
   */
  image->name = name;
  image->pixels = scm_gc_malloc (width * height, "image pixels");

  return smob;
}

SCM
clear_image (SCM image_smob)
{
  int area;
  struct image *image;

  scm_assert_smob_type (image_tag, image_smob);

  image = (struct image *) SCM_SMOB_DATA (image_smob);
  area = image->width * image->height;
  memset (image->pixels, 0, area);

  /* Invoke the image's update function.
   */
  if (scm_is_true (image->update_func))
    scm_call_0 (image->update_func);

  scm_remember_upto_here_1 (image_smob);

  return SCM_UNSPECIFIED;
}

static SCM
mark_image (SCM image_smob)
{
  /* Mark the image's name and update function.  */
  struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);

  scm_gc_mark (image->name);
  return image->update_func;
}

static size_t
free_image (SCM image_smob)
{
  struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);

  scm_gc_free (image->pixels, image->width * image->height, "image pixels");
  scm_gc_free (image, sizeof (struct image), "image");

  return 0;
}

static int
print_image (SCM image_smob, SCM port, scm_print_state *pstate)
{
  struct image *image = (struct image *) SCM_SMOB_DATA (image_smob);

  scm_puts ("#<image ", port);
  scm_display (image->name, port);
  scm_puts (">", port);

  /* non-zero means success */
  return 1;
}

void
init_image_type (void)
{
  image_tag = scm_make_smob_type ("image", sizeof (struct image));
  scm_set_smob_mark (image_tag, mark_image);
  scm_set_smob_free (image_tag, free_image);
  scm_set_smob_print (image_tag, print_image);

  scm_c_define_gsubr ("clear-image", 1, 0, 0, clear_image);
  scm_c_define_gsubr ("make-image", 3, 0, 0, make_image);
}


code:
/* file "image-type.h" */

void init_image_type (void);


code:
/* myguile.c
 *
 *	Copyright (C) 1998, 2006 Free Software Foundation, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this software; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 */

#include <libguile.h>
#include "image-type.h"

static void
inner_main (void *closure, int argc, char **argv)
{
  /* module initializations would go here */
  init_image_type();
  scm_shell (argc, argv);
}

int
main (int argc, char **argv)
{
  scm_boot_guile (argc, argv, inner_main, 0);
  return 0; /* never reached */
}