Skip to content
config.h.in 10.3 KiB
Newer Older
/*
    config.h.in -- Template configuration file.
*/
/*
    Copyright (c) 1990, Giuseppe Attardi.
    Copyright (c) 2001, Juan Jose Garcia Ripoll.
    Copyright (c) 2010-2012, Jean-Claude Beaudoin.

    MKCL is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 3 of the License, or (at your option) any later version.

    See file './Copyright' for full details.
*/

#ifndef MKCL_CONFIG_H
#define MKCL_CONFIG_H

#define MKCL_DEBUG_INTERRUPT_MASK 1

/*
 * If MKCL_API has been predefined, that means we are building the core
 * library and, under windows, we must tell the compiler to export
 * extern functions from the shared library.
 * If MKCL_API is not defined, we are simply building an application that
 * uses MKCL and, under windows, we must tell the compiler that certain elements
 * will be imported from a DLL.
 */
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(cygwin)
# define MKCL_WINDOWS 1 /* This one stands as a shorthand for the test above. */
# define MKCL_DLLEXPORT __declspec(dllexport)
# ifdef MKCL_API
#  undef \
   MKCL_API /* Avoid autoconf removing this */
#  define MKCL_API __declspec(dllexport)
# else
#  define MKCL_API __declspec(dllimport)
# endif
#else /* unix and linux */
# define MKCL_DLLEXPORT
# ifdef MKCL_API
#  undef \
   MKCL_API /* Avoid autoconf removing this */
# endif
# define MKCL_API
#endif

/* Decimal number made with the formula: MAJOR * 1000000 + MINOR * 10000 + PATCH */
#define MKCL_VERSION_NUMBER @MKCL_VERSION_NUMBER@
#define MKCL_MAJOR_VERSION @MKCL_MAJOR_VERSION@
#define MKCL_MINOR_VERSION @MKCL_MINOR_VERSION@
#define MKCL_PATCH_LEVEL @MKCL_PATCH_LEVEL@
#define MKCL_VERSION_STRING "@MKCL_MAJOR_VERSION@.@MKCL_MINOR_VERSION@.@MKCL_PATCH_LEVEL@"
#define MKCL_MAJOR_MINOR_VERSION_STRING "@MKCL_MAJOR_VERSION@.@MKCL_MINOR_VERSION@"
#define MKCL_MAJOR_VERSION_STRING "@MKCL_MAJOR_VERSION@"
#define MKCL_MINOR_VERSION_STRING "@MKCL_MINOR_VERSION@"
#define MKCL_PATCH_LEVEL_STRING "@MKCL_PATCH_LEVEL@"

#define MKCL_LIBDIR_DEFAULT "@mkcldir@"

/*
 * FEATURES LINKED IN
 */

/* Use GNU Multiple Precision library for bignums                       */
#include <@MKCL_GMP_HEADER@>

#if defined(_MSC_VER) || defined(__MINGW32__)
# define MKCL_WSOCK
#endif

/* Foreign functions interface						*/
/* #undef MKCL_FFI */

/* Allow STREAM operations to work on arbitrary objects			*/
/* #undef MKCL_CLOS_STREAMS */

/* Stack grows downwards						*/
#undef MKCL_DOWN_STACK

/* We have non-portable implementation of FFI calls			*/
/* #undef MKCL_DYNAMIC_FFI */

/* We use hierarchical package names, like in Allegro CL                */
#undef MKCL_RELATIVE_PACKAGE_NAMES


/* Integer types                        				*/
@MKCL_STDINT_HEADER@
#undef mkcl_uint8_t
#undef mkcl_int8_t
#undef mkcl_uint16_t
#undef mkcl_int16_t
#undef mkcl_uint32_t
#undef mkcl_int32_t
#undef mkcl_uint64_t
#undef mkcl_int64_t
#undef mkcl_long_long_t
#undef mkcl_ulong_long_t

/*
 * C TYPES AND SYSTEM LIMITS
 */
#include <limits.h>

/*
 * The integer type
 *
 * mkcl_word must be an integer type, large enough to hold a pointer.
 * Ideally, according to the ISOC99 standard, we should use intptr_t,
 * but the required headers are not present in all systems. Hence we
 * use autoconf to guess the following values.
 */
#define MKCL_INT_BITS           @CL_INT_BITS@
#define MKCL_LONG_BITS          @CL_LONG_BITS@
#define MKCL_WORD_BITS          @CL_FIXNUM_BITS@
#define MKCL_MOST_POSITIVE_FIXNUM	((mkcl_word)@CL_FIXNUM_MAX@)
#define MKCL_MOST_NEGATIVE_FIXNUM	((mkcl_word)@CL_FIXNUM_MIN@)
#define MKCL_MOST_POSITIVE_FIXNUM_RAW	(@CL_FIXNUM_MAX@)
#define MKCL_MOST_NEGATIVE_FIXNUM_RAW	(@CL_FIXNUM_MIN@)

typedef @CL_FIXNUM_TYPE@ mkcl_word;
typedef unsigned @CL_FIXNUM_TYPE@ mkcl_index;
typedef unsigned @CL_FIXNUM_TYPE@ mkcl_hashkey;

/*
 * The character type
 */
#define	MKCL_CHAR_CODE_LIMIT	1114112	/*  unicode character code limit (0x110000) */
#define	MKCL_BASE_CHAR_CODE_LIMIT 256	/*  unicode character code limit (0x100) */

/*
 * Array limits
 */
#define	MKCL_ARANKLIM	64		/*  array rank limit  		*/
#define	MKCL_ADIMLIM		@CL_FIXNUM_MAX@	/*  array dimension limit	*/
#define	MKCL_ATOTLIM		@CL_FIXNUM_MAX@	/*  array total limit		*/

/*
 * Function limits.
 *
 * In general, any of these limits must fit in a "mkcl_word".
 */
/*	Maximum number of function arguments (arbitrary)		*/
#define MKCL_CALL_ARGUMENTS_LIMIT MKCL_MOST_POSITIVE_FIXNUM  /* Used to be 65536. JCB */

/*	Maximum number of required arguments				*/
#define MKCL_LAMBDA_PARAMETERS_LIMIT MKCL_CALL_ARGUMENTS_LIMIT

/*	Numb. of args. which will be passed using the C stack		*/
/*	See cmplam.lsp if you change this value				*/
#define MKCL_C_ARGUMENTS_LIMIT 64

/*	Maximum number of output arguments (>= MKCL_C_ARGUMENTS_LIMIT)	*/
#define MKCL_MULTIPLE_VALUES_LIMIT 64

/* A setjmp that does not save signals					*/
#if __unix__
/* Setting the second argument of sigsetjmp to TRUE causes a severe 
   speed performance degradation of the catch/throw facility.
   Can it be justified? JCB */
# define mkcl_setjmp(buf) sigsetjmp(buf, FALSE)
# define mkcl_longjmp(buf, val)	siglongjmp(buf, val)
# define mkcl_jmp_buf sigjmp_buf
#else
# define mkcl_setjmp	@MKCL_SETJMP@
# define mkcl_longjmp	@MKCL_LONGJMP@
# define mkcl_jmp_buf jmp_buf
#endif

/*
 * Structure/Instance limits. The index to a slot must fit in the
 * "int" type. We also require MKCL_SLOTS_LIMIT <= CALL_ARGUMENTS_LIMIT
 * because constructors typically require as many arguments as slots,
 * or more.
 */
#define MKCL_SLOTS_LIMIT	32768

/* compiler understands long double                                     */
#undef HAVE_LONG_DOUBLE
#if 0 /* defined(unix) */ /* def HAVE_LONG_DOUBLE */
/* This is commented out because printing of long double based long-float
   is still unstable. 2011/02/07 JCB
*/
# define MKCL_LONG_FLOAT
#endif
/* compiler understands complex                                         */
#undef HAVE_DOUBLE_COMPLEX
#undef HAVE_FLOAT_COMPLEX


#endif /* MKCL_CONFIG_H */

/* -CUT-: Everything below this mark will not be installed		*/
/* -------------------------------------------------------------------- *
 *	BUILD OPTIONS WHICH NEED NOT BE EXPORTED			*
 * -------------------------------------------------------------------- */
/*
 * FEATURES LINKED IN:
 */

#ifndef MKCL_CONFIG_H_2
#define MKCL_CONFIG_H_2

/*
 * SYSTEM FEATURES:
 */

/* Argument list can be access as an array				*/
#undef MKCL_USE_VARARG_AS_POINTER
/* Most significant byte first						*/
#undef MKCL_WORDS_BIGENDIAN
/* Has <sys/resource.h>							*/
#undef HAVE_SYS_RESOURCE_H
#undef HAVE_ULIMIT_H
/* High precision timer							*/
#undef HAVE_NANOSLEEP
/* Float version if isnan()						*/
#undef HAVE_ISNANF
/* float.h for epsilons, maximum real numbers, etc			*/
#undef HAVE_FLOAT_H
/* select()								*/
#undef HAVE_SELECT
#undef HAVE_SYS_SELECT_H
#undef HAVE_SYS_IOCTL_H
/* putenv() or setenv()							*/
#undef HAVE_SETENV
#undef HAVE_PUTENV
/* times() and sys/times.h						*/
#undef HAVE_TIMES
/* gettimeofday() and sys/time.h					*/
#undef HAVE_GETTIMEOFDAY
/* getrusage() and sys/resource.h					*/
#undef HAVE_GETRUSAGE
/* user home directory, user name, etc...				*/
#undef HAVE_PW_H
/* symbolic links and checking their existence				*/
#undef HAVE_LSTAT
/* safe creation of temporary files					*/
#undef HAVE_MKSTEMP
/* timer for userland threads						*/
#undef HAVE_ALARM
/* filesytem								*/
#undef HAVE_DIRENT_H
/* dynamic linking of libraries						*/
#undef HAVE_DLFCN_H
#undef HAVE_LINK_H
#undef HAVE_MACH_O_DYLD_H
/* POSIX signals							*/
#undef HAVE_SIGPROCMASK
/* isatty() checks whether a file is connected to a			*/
#undef HAVE_ISATTY
/* can manipulate floating point environment				*/
#undef HAVE_FENV_H
/* can activate individual traps in floating point environment		*/
#undef HAVE_FEENABLEEXCEPT
/* do we want to deactivate all support for floating point exceptions   */
#undef MKCL_AVOID_FPE_H
/* do we want to have signed zeros					*/
#undef MKCL_SIGNED_ZERO
/* do we want NaNs and Infs						*/
#undef MKCL_IEEE_FP
/* has support for large files						*/
#undef HAVE_FSEEKO
/* the tzset() function gets the current time zone			*/
#undef HAVE_TZSET
/* several floating point functions (ISO C99)				*/
#undef HAVE_EXPF
#undef HAVE_LOGF
#undef HAVE_SQRTF
#undef HAVE_COSF
#undef HAVE_SINF
#undef HAVE_TANF
#undef HAVE_SINHF
#undef HAVE_COSHF
#undef HAVE_TANHF
#undef HAVE_FLOORF
#undef HAVE_CEILF
#undef HAVE_FABSF
#undef HAVE_FREXPF
#undef HAVE_LDEXPF
#undef HAVE_LOG1P
#undef HAVE_LOG1PF
#undef HAVE_LOG1PL
#undef HAVE_COPYSIGNF
#undef HAVE_COPYSIGN
#undef HAVE_COPYSIGNL
/* whether we have sched_yield() that gives priority to other threads	*/
#undef HAVE_SCHED_YIELD
/* uname() for system identification					*/
#undef HAVE_UNAME
#undef HAVE_UNISTD_H
#undef HAVE_SYS_WAIT_H
/* size of long long            					*/
#undef MKCL_LONG_LONG_BITS

/* what characters are used to mark beginning of new line		*/
#undef MKCL_NEWLINE_IS_CRLF
#undef MKCL_NEWLINE_IS_LFCR

/*
 * PARAMETERS:
 */

/* We allocate a number of strings in a pool which is used to speed up reading */
#define MKCL_MAX_STRING_POOL_SIZE	10
#define MKCL_BUFFER_STRING_SIZE		128

#undef FILE_CNT
#if @MKCL_FILE_CNT@ == 1
#  define FILE_CNT(fp)	((fp)->_IO_read_end - (fp)->_IO_read_ptr)
#endif
#if @MKCL_FILE_CNT@ == 2
#  define FILE_CNT(fp)	((fp)->_r)
#endif
#if @MKCL_FILE_CNT@ == 3
#  define FILE_CNT(fp)	((fp)->_cnt)
#endif

#if defined(cygwin) || defined(__MINGW32__) || defined(_MSC_VER)
#  define MKCL_IS_DIR_SEPARATOR(x) (((x)=='/')||((x)=='\\'))
# if 0
#  define MKCL_DIR_SEPARATOR	'/'
# else
#  define MKCL_DIR_SEPARATOR	'\\'
# endif
#  define MKCL_PATH_SEPARATOR	';'
#else
#  define MKCL_IS_DIR_SEPARATOR(x) ((x)=='/')
#  define MKCL_DIR_SEPARATOR	'/'
#  define MKCL_PATH_SEPARATOR	':'
#endif

#define MKCL_ARCHITECTURE "@ARCHITECTURE@"

#if defined(__i386) || defined(__x86_64)
# define MKCL_LSB_FIRST 1 /* On Intel and compatibles, the Least Significant Bit comes first (bit 0). */
# define MKCL_LITTLE_ENDIAN 1
#endif

#ifdef MKCL_AVOID_FPE_H
# define mkcl_detect_fpe()
#elif defined(__i386) || defined(__x86_64)
# ifdef _MSC_VER
#  define mkcl_detect_fpe() __asm fwait
# elif defined(__GNUC__)
#  define mkcl_detect_fpe() asm("fwait")
# else
#  error "Macro mkcl_detect_fpe() is not defined for this architecture."
# endif
#else
# define mkcl_detect_fpe() (void)0
#endif

#endif /* MKCL_CONFIG_H_2 */