Blame configure.in

Packit 8a864e
AC_REVISION([$Id: configure.in,v 1.29.2.41 2005/12/16 08:12:19 tbe Exp $])
Packit 8a864e
dnl
Packit 8a864e
dnl  Process this file with autoconf to produce a configure script.
Packit 8a864e
dnl
Packit 8a864e
dnl  Copyright (C) 1998 Cees A. de Groot
Packit 8a864e
dnl
Packit 8a864e
Packit 8a864e
dnl
Packit 8a864e
dnl  Credits: this autoconf script was largely "inspired" <g> by the
Packit 8a864e
dnl  autoconf script around SP made by Henry Thompson.
Packit 8a864e
dnl
Packit 8a864e
Packit 8a864e
dnl Initialization.
Packit 8a864e
AC_INIT
Packit 8a864e
AC_CONFIG_SRCDIR([pubtext])
Packit 8a864e
AM_INIT_AUTOMAKE(OpenSP, 1.5.2, no-define)
Packit 8a864e
AM_MAINTAINER_MODE
Packit 8a864e
AC_PREREQ(2.53)
Packit 8a864e
AM_CONFIG_HEADER(config.h)
Packit 8a864e
AM_SANITY_CHECK
Packit 8a864e
Packit 8a864e
dnl Autoheader definitions
Packit 8a864e
Packit 8a864e
AH_TEMPLATE([HAVE_CATGETS],[Define if you have the gettext() function])
Packit 8a864e
AH_TEMPLATE([SGML_CATALOG_FILES_DEFAULT],[set this to the default catalog files list])
Packit 8a864e
AH_TEMPLATE([SGML_SEARCH_PATH_DEFAULT],[set this to the default SGML search path])
Packit 8a864e
AH_TEMPLATE([SP_DECLARE_H_ERRNO],[define this if h_errno should be declared extern int])
Packit 8a864e
AH_TEMPLATE([DECLARE_MEMMOVE],[define this if memmove  should be declared extern "C"])
Packit 8a864e
AH_TEMPLATE([DECLARE_STRERROR],[define this if strerror should be declared extern "C"])
Packit 8a864e
AH_TEMPLATE([SP_HAVE_SOCKET],[define this if sockets are available])
Packit 8a864e
AH_TEMPLATE([sig_atomic_t],[define this appropriately if the type sig_atomic_t is not available])
Packit 8a864e
AH_TEMPLATE([SP_NEW_H_MISSING],[define this if your system misses new.h])
Packit 8a864e
AH_TEMPLATE([SP_SET_NEW_HANDLER_EXTERN_C],[define this if  set_new_handler() has to be declared extern "C"])
Packit 8a864e
AC_DEFINE(SP_MULTI_BYTE,[1],[define this to build a multi-byte version])
Packit 8a864e
AH_TEMPLATE([SP_DEFINE_TEMPLATES],[define this to include template definitions in the headers])
Packit 8a864e
AH_TEMPLATE([SP_MANUAL_INST],[define this to compile explicit template instantiations])
Packit 8a864e
AH_TEMPLATE([SP_FANCY_NEW_HANDLER],[define this if the new handler takes size_t and returns int.])
Packit 8a864e
AH_TEMPLATE([PATH_SEPARATOR],[set this to the path separator])
Packit 8a864e
AH_TEMPLATE([DEFAULT_ERROR_LIMIT],[if this is not set it defaults to 200 ])
Packit 8a864e
AH_TEMPLATE([SP_USE_OWN_ASSERT],[define this if you can't or don't want to use the builtin assert() macro])
Packit 8a864e
AH_TEMPLATE([SP_LINE_TERM1],[set this to the first line term character])
Packit 8a864e
AH_TEMPLATE([SP_LINE_TERM2],[set this to the second line term character])
Packit 8a864e
Packit 8a864e
dnl These are really windows only
Packit 8a864e
Packit 8a864e
AH_TEMPLATE([SP_MUTEX_WIN32],[define this to use win32 mutex mechanisms])
Packit 8a864e
AH_TEMPLATE([SP_HAVE_SETMODE],[define this if _setmode is supported])
Packit 8a864e
AH_TEMPLATE([SP_NO_MESSAGE_TEXT],[define this to not compile message texts in])
Packit 8a864e
AH_TEMPLATE([SP_USE_DLL],[define this to build a dll])
Packit 8a864e
AH_TEMPLATE([SP_DLLEXPORT],[define this to build a dll])
Packit 8a864e
AH_TEMPLATE([SP_DLLIMPORT],[define this tobuild a dll])
Packit 8a864e
AH_TEMPLATE([SP_WIDE_SYSTEM],[define this if the OS provides wide character interfaces])
Packit 8a864e
AH_TEMPLATE([SP_PCH],[define this to enable precompiled header support])
Packit 8a864e
AH_TEMPLATE([SP_LOCALE_DIR],[the location we install our messages])
Packit 8a864e
Packit 8a864e
AH_TEMPLATE([SIZEOF_WCHAR_T],[size of wchar_t])
Packit 8a864e
Packit 8a864e
AH_BOTTOM([
Packit 8a864e
#ifdef HAVE_UNISTD_H
Packit 8a864e
#define SP_INCLUDE_UNISTD_H
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef HAVE_IO_H
Packit 8a864e
#undef SP_INCLUDE_IO_H
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef HAVE_OSFCN_H
Packit 8a864e
#undef SP_INCLUDE_OSFCN_H
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifndef SP_MSDOS_FILENAMES
Packit 8a864e
#define SP_POSIX_FILENAMES
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef HAVE_ST_BLKSIZE
Packit 8a864e
#define SP_STAT_BLKSIZE
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef HAVE_BOOL
Packit 8a864e
#ifndef SP_HAVE_BOOL
Packit 8a864e
#define SP_HAVE_BOOL
Packit 8a864e
#endif
Packit 8a864e
#endif /* HAVE_BOOL */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_TYPENAME
Packit 8a864e
#define SP_HAVE_TYPENAME
Packit 8a864e
#endif /* HAVE_TYPENAME */
Packit 8a864e
Packit 8a864e
#if (SIZEOF_BOOL == 1)
Packit 8a864e
#define SP_SIZEOF_BOOL_1
Packit 8a864e
#endif
Packit 8a864e
Packit Service 7c878b
#if (WCHAR_MAX == SHRT_MAX)
Packit 8a864e
#define SP_WCHAR_T_USHORT
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef SP_HAVE_SETMODE
Packit 8a864e
#ifndef SP_LINE_TERM1
Packit 8a864e
#define SP_LINE_TERM1 '\r'
Packit 8a864e
#define SP_LINE_TERM2 '\n'
Packit 8a864e
#endif
Packit 8a864e
#endif /* not SP_HAVE_SETMODE */
Packit 8a864e
Packit 8a864e
#ifndef SP_LINE_TERM1
Packit 8a864e
#define SP_LINE_TERM1 '\n'
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifndef HAVE_NEW_FOR_SCOPING
Packit 8a864e
// This simulates the new ANSI "for" scope rules
Packit 8a864e
#define for if (0); else for
Packit 8a864e
#endif /* HAVE_NEW_FOR_SCOPING */
Packit 8a864e
Packit 8a864e
#ifndef SP_HAVE_TYPENAME
Packit 8a864e
#define typename /* as nothing */
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifndef SP_DLLEXPORT
Packit 8a864e
#define SP_DLLEXPORT /* as nothing */
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifndef SP_DLLIMPORT
Packit 8a864e
#define SP_DLLIMPORT /* as nothing */
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef SP_USE_DLL
Packit 8a864e
Packit 8a864e
#ifdef BUILD_LIBSP
Packit 8a864e
#define SP_API SP_DLLEXPORT
Packit 8a864e
#else
Packit 8a864e
#define SP_API SP_DLLIMPORT
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#else /* not SP_USE_DLL */
Packit 8a864e
Packit 8a864e
#define SP_API /* as nothing */
Packit 8a864e
Packit 8a864e
#endif /* not SP_USE_DLL */
Packit 8a864e
Packit 8a864e
#ifdef SP_WIDE_SYSTEM
Packit 8a864e
#ifndef SP_MULTI_BYTE
Packit 8a864e
#define SP_MULTI_BYTE
Packit 8a864e
#endif
Packit 8a864e
#endif
Packit 8a864e
Packit 8a864e
#ifdef HAVE_NAMESPACES
Packit 8a864e
#define SP_NAMESPACE OpenSP
Packit 8a864e
#endif /* HAVE_NAMESPACES */
Packit 8a864e
Packit 8a864e
#ifdef SP_NAMESPACE
Packit 8a864e
#define SP_NAMESPACE_SCOPE SP_NAMESPACE::
Packit 8a864e
#else
Packit 8a864e
#define SP_NAMESPACE_SCOPE
Packit 8a864e
#endif /* SP_NAMESPACE */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_DYNAMIC_CAST
Packit 8a864e
#define SP_HAVE_RTTI
Packit 8a864e
#endif /* HAVE_DYNAMIC_CAST */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_PATHNAME_STYLE_DOS
Packit 8a864e
#define SP_MSDOS_FILENAMES
Packit 8a864e
#else
Packit 8a864e
#define SP_POSIX_FILENAMES
Packit 8a864e
#endif /* HAVE_PATHNAME_STYLE_DOS */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_INSTANTIATIONS
Packit 8a864e
#ifndef SP_ANSI_CLASS_INST
Packit 8a864e
#define SP_ANSI_CLASS_INST
Packit 8a864e
#endif
Packit 8a864e
#endif /* HAVE_INSTANTIATIONS */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_SETLOCALE
Packit 8a864e
#ifndef SP_HAVE_LOCALE
Packit 8a864e
#define SP_HAVE_LOCALE
Packit 8a864e
#endif
Packit 8a864e
#endif /* HAVE_SETLOCALE */
Packit 8a864e
Packit 8a864e
#if defined(HAVE_GETTEXT) && defined(ENABLE_NLS)
Packit 8a864e
#ifndef SP_HAVE_GETTEXT
Packit 8a864e
#define SP_HAVE_GETTEXT
Packit 8a864e
#endif
Packit 8a864e
#endif /* HAVE_GETTEXT && ENABLE_NLS */
Packit 8a864e
Packit 8a864e
#ifdef WORDS_BIGENDIAN
Packit 8a864e
#define SP_BIG_ENDIAN
Packit 8a864e
#endif /* WORDS_BIGENDIAN */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_LIBTHREADS
Packit 8a864e
#define SP_MUTEX_MACH
Packit 8a864e
#endif /* HAVE_LIBTHREADS */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_LIBPTHREAD
Packit 8a864e
#define SP_MUTEX_PTHREADS
Packit 8a864e
#endif /* HAVE_LIBPTHREAD */
Packit 8a864e
Packit 8a864e
#ifdef HAVE_PLACEMENT_OPERATOR_DELETE
Packit 8a864e
#define SP_HAVE_PLACEMENT_OPERATOR_DELETE
Packit 8a864e
#endif /* HAVE_PLACEMENT_OPERATOR_DELETE */
Packit 8a864e
Packit 8a864e
#ifndef HAVE_PLACEMENT_OPERATOR_NEW
Packit 8a864e
#define SP_DECLARE_PLACEMENT_OPERATOR_NEW
Packit 8a864e
#endif /* HAVE_PLACEMENT_OPERATOR_NEW */
Packit 8a864e
Packit 8a864e
#ifndef HAVE_NAMESPACE_STD
Packit 8a864e
#define SP_NO_STD_NAMESPACE
Packit 8a864e
#endif /* HAVE_NAMESPACE_STD */
Packit 8a864e
Packit 8a864e
#if defined(HAVE_NEW) && defined(HAVE_CASSERT)
Packit 8a864e
#define SP_ANSI_LIB 1
Packit 8a864e
#endif /* HAVE_NEW && HAVE_CASSERT */
Packit 8a864e
Packit 8a864e
#ifndef HAVE_MUTABLE
Packit 8a864e
#define mutable
Packit 8a864e
#endif /* HAVE_MUTABLE */
Packit 8a864e
])
Packit 8a864e
Packit 8a864e
dnl Since config.h gets included by user programs, we use special names
Packit 8a864e
dnl for PACKAGE and VERSION.
Packit 8a864e
AC_DEFINE_UNQUOTED(SP_PACKAGE, "$PACKAGE", [Package name])
Packit 8a864e
AC_DEFINE_UNQUOTED(SP_VERSION, "$VERSION", [Package version])
Packit 8a864e
Packit 8a864e
dnl libosp current:revision:age
Packit 8a864e
SP_LIBOSP_CUR=5
Packit 8a864e
dnl AC_DEFINE_UNQUOTED(SP_LIBOSP_CUR, "$SP_LIBOSP_CUR", [libosp current])
Packit 8a864e
AC_SUBST(SP_LIBOSP_CUR)
Packit 8a864e
AC_SUBST(SP_LIBOSP_REV, 0)
Packit 8a864e
AC_SUBST(SP_LIBOSP_AGE, 0)
Packit 8a864e
Packit 8a864e
dnl Check for programs.
Packit 8a864e
AC_PROG_CC
Packit 8a864e
AC_PROG_CPP
Packit 8a864e
AC_PROG_CXX
Packit 8a864e
AC_PROG_CXXCPP
Packit 8a864e
AC_PROG_INSTALL
Packit 8a864e
AC_PROG_LN_S
Packit 8a864e
AC_PROG_MAKE_SET
Packit 8a864e
AC_PATH_PROGS(PERL, perl, perl)
Packit 8a864e
AC_PROG_LIBTOOL
Packit 8a864e
dnl Checks for libraries.
Packit 8a864e
AC_CHECK_LIB(pthread,pthread_create,,AC_CHECK_LIB(threads,cthread_fork))
Packit 8a864e
Packit 8a864e
AM_GNU_GETTEXT
Packit 8a864e
AM_GNU_GETTEXT_VERSION([0.14.5])
Packit 8a864e
AC_CHECK_HEADERS(locale.h)
Packit 8a864e
AC_DEFINE_DIR(SP_LOCALE_DIR, datadir/locale, [location of message catalogs])
Packit 8a864e
SP_MESSAGE_DOMAIN="sp$SP_LIBOSP_CUR"
Packit 8a864e
AC_DEFINE_UNQUOTED(SP_MESSAGE_DOMAIN, "$SP_MESSAGE_DOMAIN", [message domain])
Packit 8a864e
AC_SUBST(SP_MESSAGE_DOMAIN)
Packit 8a864e
Packit 8a864e
dnl Checks for header files.
Packit 8a864e
AC_HEADER_STDC
Packit 8a864e
AC_CHECK_HEADERS(limits.h unistd.h io.h osfcn.h)
Packit 8a864e
AC_LANG([C++])
Packit 8a864e
AC_CHECK_HEADERS(new cassert)
Packit 8a864e
Packit 8a864e
dnl Checks for typedefs, structures, and compiler characteristics.
Packit 8a864e
AC_C_BIGENDIAN
Packit 8a864e
AC_TYPE_SIZE_T
Packit 8a864e
AC_DIAGNOSE([obsolete],[AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_BLKSIZE:
Packit 8a864e
        your code should no longer depend upon `HAVE_ST_BLKSIZE', but
Packit 8a864e
        `HAVE_STRUCT_STAT_ST_BLKSIZE'.  Remove this warning and
Packit 8a864e
        the `AC_DEFINE' when you adjust the code.])
Packit 8a864e
AC_CHECK_MEMBERS([struct stat.st_blksize],[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
Packit 8a864e
                            [Define to 1 if your `struct stat' has
Packit 8a864e
                             `st_blksize'.  Deprecated, use
Packit 8a864e
                             `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])])
Packit 8a864e
:
Packit 8a864e
        your code should no longer depend upon `HAVE_ST_BLKSIZE', but
Packit 8a864e
        `HAVE_STRUCT_STAT_ST_BLKSIZE'.  Remove this warning and
Packit 8a864e
        the `AC_DEFINE' when you adjust the code.])
Packit 8a864e
AC_CHECK_MEMBERS([struct stat.st_blksize],[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
Packit 8a864e
                            [Define if your `struct stat' has
Packit 8a864e
                             `st_blksize'.  Deprecated, use
Packit 8a864e
                             `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])])
Packit 8a864e
Packit 8a864e
AC_CACHE_CHECK(for sig_atomic_t in signal.h,
Packit 8a864e
    ac_cv_have_sig_atomic_t,
Packit 8a864e
    AC_TRY_LINK([#include <signal.h>],sig_atomic_t x;,
Packit 8a864e
	ac_cv_have_sig_atomic_t=yes,
Packit 8a864e
	ac_cv_have_sig_atomic_t=no))
Packit 8a864e
if test "$ac_cv_have_sig_atomic_t" = "no"
Packit 8a864e
then
Packit 8a864e
    AC_CHECK_TYPE(sig_atomic_t,int)
Packit 8a864e
fi
Packit 8a864e
AC_CHECK_SIZEOF(size_t)
Packit 8a864e
AC_CHECK_SIZEOF(unsigned int)
Packit 8a864e
AC_CHECK_SIZEOF(unsigned short)
Packit 8a864e
AC_CHECK_SIZEOF(wchar_t,,[
Packit 8a864e
  #include <stdio.h>
Packit 8a864e
  #include <wchar.h>])
Packit 8a864e
AC_CXX_BOOL
Packit 8a864e
if test "$ac_cv_cxx_bool" = yes; then
Packit 8a864e
  AC_CHECK_SIZEOF(bool)
Packit 8a864e
fi
Packit 8a864e
AC_CXX_MUTABLE
Packit 8a864e
AC_CXX_TYPENAME
Packit 8a864e
AC_CXX_NEW_FOR_SCOPING
Packit 8a864e
AC_CXX_PLACEMENT_OPERATOR_DELETE
Packit 8a864e
AC_CXX_DYNAMIC_CAST
Packit 8a864e
AC_CXX_NAMESPACES
Packit 8a864e
AC_CXX_EXPLICIT_INSTANTIATIONS
Packit 8a864e
AC_CACHE_CHECK(for placement operator new,
Packit 8a864e
ac_cv_cxx_placement_operator_new,
Packit 8a864e
[AC_TRY_COMPILE([#include <stddef.h>
Packit 8a864e
#ifdef HAVE_NEW
Packit 8a864e
#include <new>
Packit 8a864e
#else
Packit 8a864e
#include <new.h>
Packit 8a864e
#endif
Packit 8a864e
class A {
Packit 8a864e
public:
Packit 8a864e
  A() {};
Packit 8a864e
};
Packit 8a864e
A* foo()
Packit 8a864e
{
Packit 8a864e
  void *x;
Packit 8a864e
  A *bar = new (x) A;
Packit 8a864e
  return bar;
Packit 8a864e
};],,
Packit 8a864e
   ac_cv_cxx_placement_operator_new=yes,
Packit 8a864e
   ac_cv_cxx_placement_operator_new=no)
Packit 8a864e
])
Packit 8a864e
if test "$ac_cv_cxx_placement_operator_new" = yes; then
Packit 8a864e
  AC_DEFINE(HAVE_PLACEMENT_OPERATOR_NEW,1,
Packit 8a864e
            [define if placement operator new is declared])
Packit 8a864e
fi
Packit 8a864e
AC_CACHE_CHECK(whether the C++ compiler supports the std namespace,
Packit 8a864e
ac_cv_cxx_namespace_std,
Packit 8a864e
[AC_TRY_COMPILE([
Packit 8a864e
#ifdef HAVE_NEW
Packit 8a864e
#include <new>
Packit 8a864e
#else
Packit 8a864e
#include <new.h>
Packit 8a864e
#endif],[
Packit 8a864e
std::set_new_handler(0);],
Packit 8a864e
   ac_cv_cxx_namespace_std=yes,
Packit 8a864e
   ac_cv_cxx_namespace_std=no)
Packit 8a864e
])
Packit 8a864e
if test "$ac_cv_cxx_namespace_std" = yes; then
Packit 8a864e
  AC_DEFINE(HAVE_NAMESPACE_STD,1,
Packit 8a864e
            [define if the C++ compiler supports the std namespace])
Packit 8a864e
fi
Packit 8a864e
if test "$GXX"; then
Packit 8a864e
dnl FIXME these need tests for non-GNU compilers
Packit 8a864e
  AC_CACHE_CHECK(whether GNU C++ supports automatic template instantiation,
Packit 8a864e
	         ac_cv_c_gnu_automatic_templates,
Packit 8a864e
                  [AC_EGREP_CPP(yes,[
Packit 8a864e
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 8)
Packit 8a864e
  yes
Packit 8a864e
#endif
Packit 8a864e
	            ],
Packit 8a864e
                    ac_cv_c_gnu_automatic_templates=yes,
Packit 8a864e
                    ac_cv_c_gnu_automatic_templates=no)
Packit 8a864e
                  ])
Packit 8a864e
  if test "$ac_cv_c_gnu_automatic_templates" = yes; then
Packit 8a864e
    AC_DEFINE(SP_DEFINE_TEMPLATES,1,
Packit 8a864e
              [define this to include template definitions in the headers])
Packit 8a864e
  else
Packit 8a864e
    AC_DEFINE(SP_MANUAL_INST,1,
Packit 8a864e
              [define this to compile explicit template instantiations])
Packit 8a864e
    CXXFLAGS="$CXXFLAGS -fno-implicit-templates"
Packit 8a864e
  fi
Packit 8a864e
  AC_CACHE_CHECK(whether GNU C++ links with libg++ if we include new.h,
Packit 8a864e
	         ac_cv_cxx_gnu_avoid_new_h,
Packit 8a864e
                 [AC_EGREP_CPP(yes,[
Packit 8a864e
#if (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
Packit 8a864e
  yes
Packit 8a864e
#endif
Packit 8a864e
	            ],
Packit 8a864e
	            ac_cv_cxx_gnu_avoid_new_h=yes,
Packit 8a864e
	            ac_cv_cxx_gnu_avoid_new_h=no)
Packit 8a864e
                  ])
Packit 8a864e
  if test "$ac_cv_cxx_gnu_avoid_new_h" = yes; then
Packit 8a864e
    AC_DEFINE(SP_NEW_H_MISSING,1,
Packit 8a864e
              [define this if your system misses new.h])
Packit 8a864e
    AC_CACHE_CHECK(whether to declare set_new_handler extern "C",
Packit 8a864e
                    ac_cv_cxx_new_handler_extern_c,
Packit 8a864e
                    [AC_TRY_LINK([
Packit 8a864e
typedef void (*new_handler)();
Packit 8a864e
new_handler set_new_handler(new_handler);],[
Packit 8a864e
set_new_handler(0);],
Packit 8a864e
                      ac_cv_cxx_new_handler_extern_c=no,
Packit 8a864e
                      ac_cv_cxx_new_handler_extern_c=yes)
Packit 8a864e
                     ])
Packit 8a864e
    if test "$ac_cv_cxx_new_handler_extern_c" = yes; then
Packit 8a864e
      AC_DEFINE(SP_SET_NEW_HANDLER_EXTERN_C,1,
Packit 8a864e
                [define this if  set_new_handler() has to be declared extern "C"])
Packit 8a864e
    fi
Packit 8a864e
  fi
Packit 8a864e
fi
Packit 8a864e
AC_CACHE_CHECK(whether new_handler accepts size_t and returns int,
Packit 8a864e
ac_cv_cxx_fancy_new_handler,
Packit 8a864e
[AC_TRY_COMPILE([
Packit 8a864e
#include <stddef.h>
Packit 8a864e
#include <new.h>
Packit 8a864e
int oom(size_t) { }],[set_new_handler(oom);],
Packit 8a864e
   ac_cv_cxx_fancy_new_handler=yes,
Packit 8a864e
   ac_cv_cxx_fancy_new_handler=no)
Packit 8a864e
 ])
Packit 8a864e
if test "$ac_cv_cxx_fancy_new_handler" = yes; then
Packit 8a864e
  AC_DEFINE(SP_FANCY_NEW_HANDLER,1,
Packit 8a864e
            [define this if the new handler takes size_t and returns int])
Packit 8a864e
fi
Packit 8a864e
Packit 8a864e
dnl Checks for library functions.
Packit 8a864e
AC_REPLACE_FUNCS(memmove memcmp strerror strtoul)
Packit 8a864e
AC_CHECK_FUNCS(setlocale)
Packit 8a864e
Packit 8a864e
dnl Checks for system services.
Packit 8a864e
ACX_CHECK_PATHNAME_STYLE_DOS
Packit 8a864e
Packit 8a864e
AC_MSG_CHECKING(whether to include support for http)
Packit 8a864e
AC_ARG_ENABLE(http,
Packit 8a864e
[  --enable-http           include support for http],
Packit 8a864e
    if test $enableval
Packit 8a864e
    then
Packit 8a864e
        AC_MSG_RESULT(yes)
Packit 8a864e
	AC_DEFINE(SP_HAVE_SOCKET,1,
Packit 8a864e
                  [define this if sockets are available])
Packit 8a864e
	AC_CHECK_LIB(nsl,main,LIBS="$LIBS -lnsl")
Packit 8a864e
	AC_CHECK_LIB(socket,main,LIBS="$LIBS -lsocket")
Packit 8a864e
	AC_MSG_CHECKING(h_errno in netdb.h)
Packit 8a864e
	AC_EGREP_HEADER(h_errno,netdb.h,
Packit 8a864e
	    AC_MSG_RESULT(yes),
Packit 8a864e
	    AC_DEFINE(SP_DECLARE_H_ERRNO,1,
Packit 8a864e
                      [define this if h_errno should be declared extern int])
Packit 8a864e
	    AC_MSG_RESULT(no))
Packit 8a864e
    else
Packit 8a864e
        AC_MSG_RESULT(no)
Packit 8a864e
    fi,
Packit 8a864e
    AC_MSG_RESULT(no))
Packit 8a864e
AC_MSG_CHECKING(for default catalog)
Packit 8a864e
AC_ARG_ENABLE(default-catalog,
Packit 8a864e
[  --enable-default-catalog=pathlist
Packit 8a864e
                          provide one or more default catalog files or
Packit 8a864e
                          sysids, e.g. /usr/local/lib/sgml/catalog],
Packit 8a864e
              if test $enableval
Packit 8a864e
               then
Packit 8a864e
                AC_MSG_RESULT($enableval)
Packit 8a864e
                AC_DEFINE_UNQUOTED(SGML_CATALOG_FILES_DEFAULT,"$enableval",
Packit 8a864e
                              [set this to the default catalog files list])
Packit 8a864e
               else
Packit 8a864e
                AC_MSG_RESULT(none)
Packit 8a864e
              fi,
Packit 8a864e
              AC_MSG_RESULT(none))
Packit 8a864e
AC_MSG_CHECKING(for default search path)
Packit 8a864e
AC_ARG_ENABLE(default-search-path,
Packit 8a864e
[  --enable-default-search-path=pathlist
Packit 8a864e
                          provide a default value for SGML_SEARCH_PATH],
Packit 8a864e
    if test $enableval
Packit 8a864e
    then
Packit 8a864e
        AC_MSG_RESULT($enableval)
Packit 8a864e
	AC_DEFINE_UNQUOTED(SGML_SEARCH_PATH_DEFAULT,"$enableval",
Packit 8a864e
                       [set this to the default SGML search path])
Packit 8a864e
    else
Packit 8a864e
        AC_MSG_RESULT(none)
Packit 8a864e
    fi,
Packit 8a864e
    AC_MSG_RESULT(none))
Packit 8a864e
AC_MSG_CHECKING(whether to include support for XML Formatted Messages)
Packit 8a864e
AC_ARG_ENABLE(xml-messages,
Packit 8a864e
[  --enable-xml-messages   include support for XML Formatted Messages],
Packit 8a864e
        if test $enableval
Packit 8a864e
           then
Packit 8a864e
              AC_MSG_RESULT(yes)
Packit 8a864e
              AC_DEFINE(SP_XML,1,[set this to enable XML Formatted Messages])
Packit 8a864e
           else
Packit 8a864e
                AC_MSG_RESULT(no)
Packit 8a864e
         fi,
Packit 8a864e
      AC_MSG_RESULT(no))
Packit 8a864e
DTDDECL=yes
Packit 8a864e
AC_MSG_CHECKING(whether to include DTDDECL support)
Packit 8a864e
AC_ARG_ENABLE(dtddecl,
Packit 8a864e
[  --disable-dtddecl       disable support for DTDDECL catalog entries],
Packit 8a864e
    if test "$enableval" = "no"
Packit 8a864e
    then
Packit 8a864e
        AC_MSG_RESULT(no)
Packit 8a864e
	DTDDECL=no
Packit 8a864e
    else
Packit 8a864e
        AC_MSG_RESULT(yes)
Packit 8a864e
    fi,
Packit 8a864e
    AC_MSG_RESULT(yes))
Packit 8a864e
if test "$DTDDECL" = "yes"
Packit 8a864e
then
Packit 8a864e
    AC_DEFINE(SP_DTDDECL,1,[set this to enable DTDDECL support])
Packit 8a864e
    AM_CONDITIONAL(DTDDECL,true)
Packit 8a864e
else
Packit 8a864e
    AM_CONDITIONAL(DTDDECL,false)
Packit 8a864e
fi
Packit 8a864e
Packit 8a864e
dnl Output.
Packit 8a864e
AC_CONFIG_FILES([${PACKAGE}-${VERSION}.spec:spec.in Makefile msggen.pl
Packit 8a864e
	lib/Makefile nsgmls/Makefile spent/Makefile
Packit 8a864e
	spam/Makefile sgmlnorm/Makefile sx/Makefile spcat/Makefile
Packit 8a864e
	include/Makefile include/config.h.old generic/Makefile doc/Makefile
Packit 8a864e
	pubtext/Makefile tests/Makefile unicode/Makefile intl/Makefile
Packit 8a864e
	po/Makefile.in])
Packit 8a864e
Packit 8a864e
BUILDDOCS=yes
Packit 8a864e
AC_MSG_CHECKING([whether to build docs (man and html)])
Packit 8a864e
AC_ARG_ENABLE(doc-build,
Packit 8a864e
    [  --disable-doc-build     do not build docs from source],
Packit 8a864e
    if test "$enableval" = "no"
Packit 8a864e
    then
Packit 8a864e
        AC_MSG_RESULT(no)
Packit 8a864e
        BUILDDOCS=no
Packit 8a864e
    else
Packit 8a864e
	AC_MSG_RESULT(yes)
Packit 8a864e
    fi,
Packit 8a864e
    AC_MSG_RESULT(yes))
Packit 8a864e
Packit 8a864e
if test "$BUILDDOCS" = "yes"
Packit 8a864e
then
Packit 8a864e
    AC_PATH_PROG(XMLTO, xmlto)
Packit 8a864e
    if test -z "$XMLTO"
Packit 8a864e
    then AC_MSG_ERROR(
Packit 8a864e
[could not find xmlto; set XMLTO or consider --disable-doc-build])
Packit 8a864e
    fi
Packit 8a864e
    AC_SUBST(DOCSRC, docsrc)
Packit 8a864e
    AC_CONFIG_FILES(docsrc/Makefile)
Packit 8a864e
fi
Packit 8a864e
Packit 8a864e
BUILDFULLDOCS=no
Packit 8a864e
AC_MSG_CHECKING([whether to build all docs (man, html, pdf, ps)])
Packit 8a864e
AC_ARG_ENABLE(full-doc-build,
Packit 8a864e
    [  --enable-full-doc-build build all docs from source],
Packit 8a864e
    if test "$enableval" = "yes"
Packit 8a864e
    then
Packit 8a864e
        AC_MSG_RESULT(yes)
Packit 8a864e
        BUILDFULLDOCS=yes
Packit 8a864e
    else
Packit 8a864e
	AC_MSG_RESULT(no)
Packit 8a864e
    fi,
Packit 8a864e
    AC_MSG_RESULT(no))
Packit 8a864e
Packit 8a864e
if test "$BUILDFULLDOCS" = "yes"
Packit 8a864e
then
Packit 8a864e
    AC_PATH_PROG(PDF2PS, pdf2ps)
Packit 8a864e
    if test -z "$PDF2PS"
Packit 8a864e
    then AC_MSG_ERROR(
Packit 8a864e
[could not find pdf2ps; set PDF2PS or consider --disable-doc-build])
Packit 8a864e
    fi
Packit 8a864e
    AC_PATH_PROG(JADE, openjade jade)
Packit 8a864e
    if test -z "$JADE"
Packit 8a864e
    then
Packit 8a864e
	AC_MSG_ERROR(
Packit 8a864e
[could not find openjade or jade; set JADE or consider --disable-doc-build])
Packit 8a864e
    fi
Packit 8a864e
    AC_PATH_PROG(JADETEX, jadetex)
Packit 8a864e
    if test -z "$JADETEX"
Packit 8a864e
    then
Packit 8a864e
	AC_MSG_ERROR(
Packit 8a864e
[could not find jadetex; set JADETEX or consider --disable-doc-build])
Packit 8a864e
    fi
Packit 8a864e
    AC_PATH_PROG(PDFJADETEX, pdfjadetex)
Packit 8a864e
    if test -z "$PDFJADETEX"
Packit 8a864e
    then
Packit 8a864e
	AC_MSG_ERROR(
Packit 8a864e
[could not find pdfjadetex; set PDFJADETEX or consider --disable-doc-build])
Packit 8a864e
    fi
Packit 8a864e
    AC_SUBST(EXTRADOCS,["releasenotes.pdf releasenotes.ps"])
Packit 8a864e
fi
Packit 8a864e
Packit 8a864e
AC_OUTPUT