AC_PREREQ(2.57) AC_INIT([SigScheme], [0.6.1], [mover@hct.zaq.ne.jp], [sigscheme]) AC_CONFIG_SRCDIR([src/sigscheme.c]) AC_CONFIG_HEADERS([src/config.h]) AM_INIT_AUTOMAKE([1.8.3 dist-bzip2]) # Checks for programs. AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_EGREP # These programs are only needed on make dist AC_PATH_PROGS(RUBY, ruby18 ruby) AC_PATH_PROGS(PERL, perl5 perl) AC_PATH_PROG(ASCIIDOC, asciidoc) # GNU sed for test-c2/collect.sh AC_PATH_PROGS(GSED, gsed sed) AC_PATH_PROG(SH, sh) # The modified version of the C testing framework AC_PATH_PROG(CUTTER, cutter) AC_PATH_PROGS(MD5, md5 md5sum) # Checks for libraries. AX_LIB_GLIBC # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([limits.h malloc.h stddef.h stdlib.h string.h \ strings.h unistd.h]) AC_CHECK_HEADER([cutter/cutter.h], have_cutter_h=yes, have_cutter_h=no) AM_CONDITIONAL(HAVE_CUTTER_H, test "x$have_cutter_h" = xyes) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_VOLATILE #AC_C_LONG_LONG #AC_C_LONG_DOUBLE AC_C_CHAR_UNSIGNED AC_C_BIGENDIAN AX_C_DATA_ALIGNED if test "x$ax_cv_c_data_aligned" = xno; then AC_MSG_ERROR([C data types are not aligned on this environment. omit -Os if you are using gcc.]) fi AX_C___ATTRIBUTE__ AC_C_STRINGIZE AX_CREATE_STDINT_H(src/sigscheme-stdint.h) AC_TYPE_SIZE_T AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) #AC_CHECK_SIZEOF(float) #AC_CHECK_SIZEOF(double) #AC_CHECK_SIZEOF(long double) AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(size_t) # Do not assume (sizeof(int32_t) == 4) and so on (i.e. do not (CHAR_BIT == 8)). AC_CHECK_SIZEOF(int16_t) AC_CHECK_SIZEOF(int32_t) AC_CHECK_SIZEOF(int64_t) #AC_CHECK_SIZEOF(int_least8_t) #AC_CHECK_SIZEOF(int_least16_t) #AC_CHECK_SIZEOF(int_least32_t) #AC_CHECK_SIZEOF(int_least64_t) #AC_CHECK_SIZEOF(int_fast8_t) #AC_CHECK_SIZEOF(int_fast16_t) AC_CHECK_SIZEOF(int_fast32_t) #AC_CHECK_SIZEOF(int_fast64_t) AC_CHECK_SIZEOF(intmax_t) AC_CHECK_SIZEOF(intptr_t) # Checks for library functions. # Enable this iff asprintf(3) or another GNU extension is needed #AC_GNU_SOURCE AC_CHECK_FUNCS([strtoll strtoimax \ fileno getcwd getpagesize]) AC_CHECK_FUNCS(posix_memalign, [ # For posix_memalign(3). although this value is overridden by _GNU_SOURCE # on glibc, keep this for other environments. AC_DEFINE(_POSIX_C_SOURCE, 200112L) ]) AH_VERBATIM(_POSIX_C_SOURCE, [/* Define to 200112L to enable posix_memalign(3). */ #if SCM_COMPILING_LIBSSCM #undef _POSIX_C_SOURCE #endif]) AC_CHECK_FUNCS(strdup, [ # Overrides _POSIX_C_SOURCE AC_DEFINE(_XOPEN_SOURCE, 500) ]) AH_VERBATIM(_XOPEN_SOURCE, [/* Define to 500 to enable strdup(3). */ #if SCM_COMPILING_LIBSSCM #undef _XOPEN_SOURCE #endif]) AC_CHECK_FUNCS(strcasecmp, [ if test "x$ax_cv_lib_glibc" = xyes; then AC_DEFINE(_BSD_SOURCE, 1) fi ], [ AC_LIBOBJ(strcasecmp) ]) AH_VERBATIM(_BSD_SOURCE, [/* Define to 1 if it is needed to enable strcasecmp(3). */ #if SCM_COMPILING_LIBSSCM #undef _BSD_SOURCE #endif]) AX_CHECK_PAGE_ALIGNED_MALLOC AC_DEFINE(SCM_ENCODING_USE_WITH_SIGSCHEME, 1, [Define to 1 to adapt encoding.c to SigScheme.]) AC_DEFINE(SCM_SCMPORT_USE_WITH_SIGSCHEME, 1, [Define to 1 to adapt scmport*.[hc] to SigScheme.]) # Default Compiler Option for gcc if test x$CC = xgcc; then CFLAGS="$CFLAGS -Wall -std=gnu89 -pedantic -Wchar-subscripts -Wmissing-declarations -Wredundant-decls -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare" fi AM_MAINTAINER_MODE AC_ARG_ENABLE(docdir, AC_HELP_STRING([--enable-docdir=DIR], [text documentation @<:@DATADIR/sigscheme/doc@:>@]), [ docdir=$enable_docdir ], [ docdir=${datadir}/${PACKAGE}/doc ]) AC_ARG_ENABLE(htmldir, AC_HELP_STRING([--enable-htmldir=DIR], [html documentation @<:@DOCDIR/html@:>@]), [ htmldir=$enable_htmldir ], [ htmldir=${docdir}/html ]) #------------------------------------------------------------------------------ # Configure Specs #------------------------------------------------------------------------------ #-------------------------------------- # Define Full Spec #-------------------------------------- # FIXME: # - Make all the variables configurable via '--enable' and '--disable', and add # brief description for each vars as original src/config.h had. #-------------------------------------- # R5RS Features #-------------------------------------- # (cannot be 0 yet) use continuation use_continuation="yes" # (cannot be 0 yet) use quasiquotation use_quasiquote="yes" # (in progress) use hygienic macros use_hygienic_macro="yes" # (not supported yet) use syntax-case; implies SCM_USE_UNHYGIENIC_MACRO use_syntax_case="no" # (not supported yet) syntactic closure use_unhygienic_macro="no" # (cannot be 0 yet) use integer numbers use_int="yes" # (not supported yet) use rational numbers use_rational="no" # (not supported yet) use real numbers use_real="no" # (not supported yet) use complex numbers use_complex="no" # (cannot be 0 yet) use character use_char="yes" # (cannot be 0 yet) use string use_string="yes" # (cannot be 0 yet) use vector use_vector="yes" # (cannot be 0 yet) use port use_port="yes" # (cannot be 0 yet) use sexp reader use_reader="yes" # (cannot be 0 yet) use sexp writer use_writer="yes" # (cannot be 0 yet) use 'load' use_load="yes" # use all c[ad]+r defined in R5RS use_deep_cadrs="yes" #-------------------------------------- # Optional Features #-------------------------------------- # use internal format which takes raw C values from va_list use_raw_c_format="yes" # use 'format+' use_sscm_format_extension="yes" # use SigScheme-specific extensions use_sscm_extensions="yes" # (not supported yet) use define-macro use_legacy_macro="no" # (not supported yet) use storage dump use_dump="no" # use scm_eval_c_string() use_eval_c_string="yes" # use SRFI-1 list library (broken) use_srfi1="no" # use SRFI-2 'and-let*' use_srfi2="yes" # use SRFI-6 basic string ports use_srfi6="yes" # use SRFI-8 'receive' use_srfi8="yes" # use SRFI-22 running scheme scripts on Unix use_srfi22="yes" # use SRFI-23 'error' use_srfi23="yes" # use SRFI-28 'format' use_srfi28="yes" # use SRFI-34 exception handling for programs use_srfi34="yes" # use SRFI-38 'write-with-shared-structure' use_srfi38="yes" # use SRFI-48 'format' (superset of SRFI-28) use_srfi48="yes" # use SRFI-60 integers as bits use_srfi60="yes" # use named characters of SRFI-75 R6RS unicode data use_srfi75_named_chars="yes" # use SRFI-75 R6RS unicode data use_srfi75="yes" # use (some) SIOD compatible features compat_siod="no" # emulate the buggy behaviors of SIOD compat_siod_bugs="no" #-------------------------------------- # Internal Behaviors #-------------------------------------- # use strict R5RS check strict_r5rs="no" # disallow quote-less () strict_null_form="no" # disallow quote-less vector literal strict_vector_form="yes" # enable strict argument check strict_argcheck="yes" # reject invalid internal definitions strict_define_placement="yes" # do all feasible encoding error checks strict_encoding_check="yes" # make list literal immutable const_list_literal="yes" # make vector literal immutable const_vector_literal="yes" # enable strict type check with accessor accessor_assert="yes" # use experimental values passing use_valuecons="yes" # enable experimental null character in a middle of a string use_null_capable_string="no" # suppress warning with little wastes use_warning_suppressor="yes" #-------------------------------------- # Storage configurations #-------------------------------------- # # Storage layer implementation: choose exclusively. # # FIXME: set other storage-dependent configurations AC_ARG_WITH(storage, AC_HELP_STRING([--with-storage=IMPL], [Choose the storage-layer implementation for SigScheme to use. IMPL={fatty|compact} (default: fatty) fatty: full-featured but memory consumptive compact: consumes half of fatty but has some limitations]), [ case $with_storage in fatty) use_storage_fatty="yes" use_storage_compact="no" ;; compact) use_storage_fatty="no" use_storage_compact="yes" ;; *) AC_MSG_ERROR([unknown storage implementation]) ;; esac ], [ use_storage_fatty="yes" use_storage_compact="no" ]) # use int64_t as scm_int_t use_64bit_fixnum="no" # use int32_t as scm_int_t use_32bit_fixnum="no" # use int as scm_int_t use_int_fixnum="no" # use long as scm_int_t (default) use_long_fixnum="no" # use int64_t as scm_intref_t use_64bit_scmref="no" # use int32_t as scm_intref_t use_32bit_scmref="no" # use intptr_t as scm_intref_t (default) use_intptr_scmref="no" #-------------------------------------- # Choose Spec #-------------------------------------- AC_ARG_ENABLE(configuration, AC_HELP_STRING([--enable-configuration=CONFIGURATION], [Choose SigScheme spec by CONFIGURATION. Following specs are currently recognized: (1)'full': Full Features. (2)'r5rs': R5RS features only. (3)'siod': SIOD compatible mode. (4)'dev': For developers. By default, 'full' is selected.]), [ case $enable_configuration in full) ;; r5rs) use_format="no" use_raw_c_format="no" use_sscm_format_extension="no" use_sscm_extensions="no" use_dump="no" use_srfi2="no" use_srfi6="no" use_srfi8="no" use_srfi22="yes" use_srfi23="no" use_srfi28="no" use_srfi34="yes" use_srfi38="yes" use_srfi48="no" use_srfi60="no" use_srfi75_named_chars="yes" use_srfi75="yes" ;; siod) compat_siod="yes" compat_siod_bugs="yes" strict_r5rs="no" strict_null_form="no" strict_argcheck="no" ;; dev) compat_siod="yes" compat_siod_bugs="yes" strict_r5rs="no" strict_null_form="no" strict_argcheck="yes" ;; *) echo "unrecognized config: '$enable_configuration'." exit 1 ;; esac ], [ enable_configuration="full" ]) #------------------------------------------------------------------------------ # Define C Preprocessor Symbols #------------------------------------------------------------------------------ #-------------------------------------- # R5RS Features #-------------------------------------- AM_CONDITIONAL(USE_CONTINUATION, test "x$use_continuation" = xyes) if test "x$use_continuation" = xyes; then AC_DEFINE(SCM_USE_CONTINUATION, 1, [use continuation]) fi AM_CONDITIONAL(USE_QUASIQUOTE, test "x$use_quasiquote" = xyes) if test "x$use_quasiquote" = xyes; then AC_DEFINE(SCM_USE_QUASIQUOTE, 1, [use quasiquotation]) fi AM_CONDITIONAL(USE_HYGIENIC_MACRO, test "x$use_hygienic_macro" = xyes) if test "x$use_hygienic_macro" = xyes; then AC_DEFINE(SCM_USE_HYGIENIC_MACRO, 1, [use hygienic macros]) fi AM_CONDITIONAL(USE_SYNTAX_CASE, test "x$use_syntax_case" = xyes) if test "x$use_syntax_case" = xyes; then AC_DEFINE(SCM_USE_SYNTAX_CASE, 1, [use sytax-case]) fi AM_CONDITIONAL(USE_UNHYGIENIC_MACRO, test "x$use_unhygienic_macro" = xyes) if test "x$use_unhygienic_macro" = xyes; then AC_DEFINE(SCM_USE_UNHYGIENIC_MACRO, 1, [syntactic closure]) fi AM_CONDITIONAL(USE_INT, test "x$use_int" = xyes) if test "x$use_int" = xyes; then AC_DEFINE(SCM_USE_INT, 1, [use integer numbers]) fi AM_CONDITIONAL(USE_RATIONAL, test "x$use_rational" = xyes) if test "x$use_rational" = xyes; then AC_DEFINE(SCM_USE_RATIONAL, 1, [use rational numbers]) fi AM_CONDITIONAL(USE_REAL, test "x$use_real" = xyes) if test "x$use_real" = xyes; then AC_DEFINE(SCM_USE_REAL, 1, [use real numbers]) fi AM_CONDITIONAL(USE_COMPLEX, test "x$use_complex" = xyes) if test "x$use_complex" = xyes; then AC_DEFINE(SCM_USE_COMPLEX, 1, [use complex numbers]) fi AM_CONDITIONAL(USE_CHAR, test "x$use_char" = xyes) if test "x$use_char" = xyes; then AC_DEFINE(SCM_USE_CHAR, 1, [use character]) fi AM_CONDITIONAL(USE_STRING, test "x$use_string" = xyes) if test "x$use_string" = xyes; then AC_DEFINE(SCM_USE_STRING, 1, [use string]) fi AM_CONDITIONAL(USE_VECTOR, test "x$use_vector" = xyes) if test "x$use_vector" = xyes; then AC_DEFINE(SCM_USE_VECTOR, 1, [use vector]) fi AM_CONDITIONAL(USE_PORT, test "x$use_port" = xyes) if test "x$use_port" = xyes; then AC_DEFINE(SCM_USE_PORT, 1, [use port]) fi AM_CONDITIONAL(USE_READER, test "x$use_reader" = xyes) if test "x$use_reader" = xyes; then AC_DEFINE(SCM_USE_READER, 1, [use sexp reader]) fi AM_CONDITIONAL(USE_WRITER, test "x$use_writer" = xyes) if test "x$use_writer" = xyes; then AC_DEFINE(SCM_USE_WRITER, 1, [use sexp writer]) fi AM_CONDITIONAL(USE_LOAD, test "x$use_load" = xyes) if test "x$use_load" = xyes; then AC_DEFINE(SCM_USE_LOAD, 1, [use 'load']) fi AM_CONDITIONAL(USE_DEEP_CADRS, test "x$use_deep_cadrs" = xyes) if test "x$use_deep_cadrs" = xyes; then AC_DEFINE(SCM_USE_DEEP_CADRS, 1, [use all c[ad]+r defined in R5RS]) fi #-------------------------------------- # Optional Features #-------------------------------------- AM_CONDITIONAL(USE_RAW_C_FORMAT, test "x$use_raw_c_format" = xyes) if test "x$use_raw_c_format" = xyes; then AC_DEFINE(SCM_USE_RAW_C_FORMAT, 1, [use internal format which takes raw C values from va_list]) fi AM_CONDITIONAL(USE_SSCM_FORMAT_EXTENSION, test "x$use_sscm_format_extension" = xyes) if test "x$use_sscm_format_extension" = xyes; then AC_DEFINE(SCM_USE_SSCM_FORMAT_EXTENSION, 1, [use 'format+']) fi AM_CONDITIONAL(USE_SSCM_EXTENSIONS, test "x$use_sscm_extensions" = xyes) if test "x$use_sscm_extensions" = xyes; then AC_DEFINE(SCM_USE_SSCM_EXTENSIONS, 1, [use SigScheme-specific extensions]) fi AM_CONDITIONAL(USE_LEGACY_MACRO, test "x$use_legacy_macro" = xyes) if test "x$use_legacy_macro" = xyes; then AC_DEFINE(SCM_USE_LEGACY_MACRO, 1, [use define-macro]) fi AM_CONDITIONAL(USE_DUMP, test "x$use_dump" = xyes) if test "x$use_dump" = xyes; then AC_DEFINE(SCM_USE_DUMP, 1, [use storage dump]) fi AM_CONDITIONAL(USE_EVAL_C_STRING, test "x$use_eval_c_string" = xyes) if test "x$use_eval_c_string" = xyes; then AC_DEFINE(SCM_USE_EVAL_C_STRING, 1, [use scm_eval_c_string()]) fi AM_CONDITIONAL(USE_SRFI1, test "x$use_srfi1" = xyes) if test "x$use_srfi1" = xyes; then AC_DEFINE(SCM_USE_SRFI1, 1, [use SRFI-1 list library (broken)]) fi AM_CONDITIONAL(USE_SRFI2, test "x$use_srfi2" = xyes) if test "x$use_srfi2" = xyes; then AC_DEFINE(SCM_USE_SRFI2, 1, [use SRFI-2 'and-let*']) fi AM_CONDITIONAL(USE_SRFI6, test "x$use_srfi6" = xyes) if test "x$use_srfi6" = xyes; then AC_DEFINE(SCM_USE_SRFI6, 1, [use SRFI-6 basic string ports]) fi AM_CONDITIONAL(USE_SRFI8, test "x$use_srfi8" = xyes) if test "x$use_srfi8" = xyes; then AC_DEFINE(SCM_USE_SRFI8, 1, [use SRFI-8 'receive']) fi AM_CONDITIONAL(USE_SRFI22, test "x$use_srfi22" = xyes) if test "x$use_srfi22" = xyes; then AC_DEFINE(SCM_USE_SRFI22, 1, [use SRFI-22 running scheme scripts on Unix]) fi AM_CONDITIONAL(USE_SRFI23, test "x$use_srfi23" = xyes) if test "x$use_srfi23" = xyes; then AC_DEFINE(SCM_USE_SRFI23, 1, [use SRFI-23 'error']) fi AM_CONDITIONAL(USE_SRFI28, test "x$use_srfi28" = xyes) if test "x$use_srfi28" = xyes; then AC_DEFINE(SCM_USE_SRFI28, 1, [use SRFI-28 'format']) fi AM_CONDITIONAL(USE_SRFI34, test "x$use_srfi34" = xyes) if test "x$use_srfi34" = xyes; then AC_DEFINE(SCM_USE_SRFI34, 1, [use SRFI-34 exception handling for programs]) fi AM_CONDITIONAL(USE_SRFI38, test "x$use_srfi38" = xyes) if test "x$use_srfi38" = xyes; then AC_DEFINE(SCM_USE_SRFI38, 1, [use SRFI-38 'write-with-shared-structure']) fi AM_CONDITIONAL(USE_SRFI48, test "x$use_srfi48" = xyes) if test "x$use_srfi48" = xyes; then AC_DEFINE(SCM_USE_SRFI48, 1, [use SRFI-48 'format' (superset of SRFI-28)]) fi AM_CONDITIONAL(USE_SRFI60, test "x$use_srfi60" = xyes) if test "x$use_srfi60" = xyes; then AC_DEFINE(SCM_USE_SRFI60, 1, [use SRFI-60 integers as bits]) fi AM_CONDITIONAL(USE_SRFI75_NAMED_CHARS, test "x$use_srfi75_named_chars" = xyes) if test "x$use_srfi75_named_chars" = xyes; then AC_DEFINE(SCM_USE_SRFI75_NAMED_CHARS, 1, [use named characters of SRFI-75 R6RS unicode data]) fi AM_CONDITIONAL(USE_SRFI75, test "x$use_srfi75" = xyes) if test "x$use_srfi75" = xyes; then AC_DEFINE(SCM_USE_SRFI75, 1, [use SRFI-75 R6RS unicode data]) fi AM_CONDITIONAL(COMPAT_SIOD, test "x$compat_siod" = xyes) if test "x$compat_siod" = xyes; then AC_DEFINE(SCM_COMPAT_SIOD, 1, [use (some) SIOD compatible features]) fi AM_CONDITIONAL(COMPAT_SIOD_BUGS, test "x$compat_siod_bugs" = xyes) if test "x$compat_siod_bugs" = xyes; then AC_DEFINE(SCM_COMPAT_SIOD_BUGS, 1, [emulate the buggy behaviors of SIOD]) fi #-------------------------------------- # Internal Behaviors #-------------------------------------- AM_CONDITIONAL(STRICT_R5RS, test "x$strict_r5rs" = xyes) if test "x$strict_r5rs" = xyes; then AC_DEFINE(SCM_STRICT_R5RS, 1, [use strict R5RS check]) fi AM_CONDITIONAL(STRICT_NULL_FORM, test "x$strict_null_form" = xyes) if test "x$strict_null_form" = xyes; then AC_DEFINE(SCM_STRICT_NULL_FORM, 1, [disallow quote-less ()]) fi AM_CONDITIONAL(STRICT_VECTOR_FORM, test "x$strict_vector_form" = xyes) if test "x$strict_vector_form" = xyes; then AC_DEFINE(SCM_STRICT_VECTOR_FORM, 1, [disallow quote-less vector literal]) fi AM_CONDITIONAL(STRICT_ARGCHECK, test "x$strict_argcheck" = xyes) if test "x$strict_argcheck" = xyes; then AC_DEFINE(SCM_STRICT_ARGCHECK, 1, [enable strict argument check]) fi AM_CONDITIONAL(STRICT_DEFINE_PLACEMENT, test "x$strict_define_placement" = xyes) if test "x$strict_define_placement" = xyes; then AC_DEFINE(SCM_STRICT_DEFINE_PLACEMENT, 1, [reject invalid internal definitions]) fi AM_CONDITIONAL(STRICT_ENCODING_CHECK, test "x$strict_encoding_check" = xyes) if test "x$strict_encoding_check" = xyes; then AC_DEFINE(SCM_STRICT_ENCODING_CHECK, 1, [do all feasible encoding error checks]) fi AM_CONDITIONAL(CONST_LIST_LITERAL, test "x$const_list_literal" = xyes) if test "x$const_list_literal" = xyes; then AC_DEFINE(SCM_CONST_LIST_LITERAL, 1, [make list literal immutable]) fi AM_CONDITIONAL(CONST_VECTOR_LITERAL, test "x$const_vector_literal" = xyes) if test "x$const_vector_literal" = xyes; then AC_DEFINE(SCM_CONST_VECTOR_LITERAL, 1, [make vector literal immutable]) fi AM_CONDITIONAL(ACCESSOR_ASSERT, test "x$accessor_assert" = xyes) if test "x$accessor_assert" = xyes; then AC_DEFINE(SCM_ACCESSOR_ASSERT, 1, [enable strict type check with accessor]) fi AM_CONDITIONAL(USE_VALUECONS, test "x$use_valuecons" = xyes) if test "x$use_valuecons" = xyes; then AC_DEFINE(SCM_USE_VALUECONS, 1, [use experimental values passing]) fi AM_CONDITIONAL(USE_NULL_CAPABLE_STRING, test "x$use_null_capable_string" = xyes) if test "x$use_null_capable_string" = xyes; then AC_DEFINE(SCM_USE_NULL_CAPABLE_STRING, 1, [enable experimental null character in a middle of a string]) fi AM_CONDITIONAL(USE_WARNING_SUPPRESSOR, test "x$use_warning_suppressor" = xyes) if test "x$use_warning_suppressor" = xyes; then AC_DEFINE(SCM_USE_WARNING_SUPPRESSOR, 1, [suppress warning with little wastes]) fi #-------------------------------------- # Storage configurations #-------------------------------------- AM_CONDITIONAL(USE_STORAGE_FATTY, test "x$use_storage_fatty" = xyes) if test "x$use_storage_fatty" = xyes; then AC_DEFINE(SCM_USE_STORAGE_FATTY, 1, [use the 'fatty' implementation]) fi AM_CONDITIONAL(USE_STORAGE_COMPACT, test "x$use_storage_compact" = xyes) if test "x$use_storage_compact" = xyes; then AC_DEFINE(SCM_USE_STORAGE_COMPACT, 1, [use the 'compact' implementation]) fi AM_CONDITIONAL(USE_64BIT_FIXNUM, test "x$use_64bit_fixnum" = xyes) if test "x$use_64bit_fixnum" = xyes; then AC_DEFINE(SCM_USE_64BIT_FIXNUM, 1, [use int64_t as scm_int_t]) fi AM_CONDITIONAL(USE_32BIT_FIXNUM, test "x$use_32bit_fixnum" = xyes) if test "x$use_32bit_fixnum" = xyes; then AC_DEFINE(SCM_USE_32BIT_FIXNUM, 1, [use int32_t as scm_int_t]) fi AM_CONDITIONAL(USE_INT_FIXNUM, test "x$use_int_fixnum" = xyes) if test "x$use_int_fixnum" = xyes; then AC_DEFINE(SCM_USE_INT_FIXNUM, 1, [use int as scm_int_t]) fi AM_CONDITIONAL(USE_LONG_FIXNUM, test "x$use_long_fixnum" = xyes) if test "x$use_long_fixnum" = xyes; then AC_DEFINE(SCM_USE_LONG_FIXNUM, 1, [use long as scm_int_t (default)]) fi AM_CONDITIONAL(USE_64BIT_SCMREF, test "x$use_64bit_scmref" = xyes) if test "x$use_64bit_scmref" = xyes; then AC_DEFINE(SCM_USE_64BIT_SCMREF, 1, [use int64_t as scm_intref_t]) fi AM_CONDITIONAL(USE_32BIT_SCMREF, test "x$use_32bit_scmref" = xyes) if test "x$use_32bit_scmref" = xyes; then AC_DEFINE(SCM_USE_32BIT_SCMREF, 1, [use int32_t as scm_intref_t]) fi AM_CONDITIONAL(USE_INTPTR_SCMREF, test "x$use_intptr_scmref" = xyes) if test "x$use_intptr_scmref" = xyes; then AC_DEFINE(SCM_USE_INTPTR_SCMREF, 1, [use intptr_t as scm_intref_t (default)]) fi #------------------------------------------------------------------------------ # Configure Character Encoding #------------------------------------------------------------------------------ use_multibyte_char="yes" use_utf8="yes" use_euccn="yes" use_eucjp="yes" use_euckr="yes" use_sjis="yes" use_utf8_as_default="yes" use_euccn_as_default="yes" use_eucjp_as_default="yes" use_euckr_as_default="yes" use_sjis_as_default="yes" # FIXME: Distinguish "default encoding" from "enabled encodings", and make # "enabled encodings" multi-specifiable. AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte=ENCODING], [Choose default encoding by ENCODING. Following encodings are available: (1)'utf8' (2)'euccn' (3)'eucjp' (4)'euckr' (5)'sjis' By default, 'utf8' is selected.]), [ case $enable_multibyte in utf8|utf-8) enable_multibyte="utf8" ;; euccn) ;; eucjp|euc-jp) enable_multibyte="eucjp" ;; euckr) ;; sjis|shift-jis) enable_multibyte="sjis" ;; *) enable_multibyte="utf8" ;; esac ], [ enable_multibyte="utf8" ]) # # Support for each encoding will be compiled in if the corresponding # macro is defined as nonzero # # TODO: make these options configurable AM_CONDITIONAL(USE_MULTIBYTE_CHAR, test "x$use_multibyte_char" = xyes) if test "x$use_multibyte_char" = xyes; then AC_DEFINE(SCM_USE_MULTIBYTE_CHAR, 1, [use multibyte]) fi AM_CONDITIONAL(USE_UTF8, test "x$use_utf8" = xyes) if test "x$use_utf8" = xyes; then AC_DEFINE(SCM_USE_UTF8, 1, [use utf8]) fi AM_CONDITIONAL(USE_EUCCN, test "x$use_euccn" = xyes) if test "x$use_euccn" = xyes; then AC_DEFINE(SCM_USE_EUCCN, 1, [use euccn]) fi AM_CONDITIONAL(USE_EUCJP, test "x$use_eucjp" = xyes) if test "x$use_eucjp" = xyes; then AC_DEFINE(SCM_USE_EUCJP, 1, [use eucjp]) fi AM_CONDITIONAL(USE_EUCKR, test "x$use_euckr" = xyes) if test "x$use_euckr" = xyes; then AC_DEFINE(SCM_USE_EUCKR, 1, [use euckr]) fi AM_CONDITIONAL(USE_SJIS, test "x$use_sjis" = xyes) if test "x$use_sjis" = xyes; then AC_DEFINE(SCM_USE_SJIS, 1, [use sjis]) fi # # choose exclusively. fallbacks to the unibyte encoding if nothing chosen. # AM_CONDITIONAL(USE_UTF8_AS_DEFAULT, test "x$enable_multibyte" = xutf8) if test "x$enable_multibyte" = xutf8; then AC_DEFINE(SCM_USE_UTF8_AS_DEFAULT, 1, [use utf8 as default]) fi AM_CONDITIONAL(USE_EUCCN_AS_DEFAULT, test "x$enable_multibyte" = xeuccn) if test "x$enable_multibyte" = xeuccn; then AC_DEFINE(SCM_USE_EUCCN_AS_DEFAULT, 1, [use euccn as default]) fi AM_CONDITIONAL(USE_EUCJP_AS_DEFAULT, test "x$enable_multibyte" = xeucjp) if test "x$enable_multibyte" = xeucjp; then AC_DEFINE(SCM_USE_EUCJP_AS_DEFAULT, 1, [use eucjp as default]) fi AM_CONDITIONAL(USE_EUCKR_AS_DEFAULT, test "x$enable_multibyte" = xeuckr) if test "x$enable_multibyte" = xeuckr; then AC_DEFINE(SCM_USE_EUCKR_AS_DEFAULT, 1, [use euckr as default]) fi AM_CONDITIONAL(USE_SJIS_AS_DEFAULT, test "x$enable_multibyte" = xsjis) if test "x$enable_multibyte" = xsjis; then AC_DEFINE(SCM_USE_SJIS_AS_DEFAULT, 1, [use sjis as default]) fi #------------------------------------------------------------------------------ # Dependency Resolution #------------------------------------------------------------------------------ # SCM_USE_NUMBER # if (SCM_USE_INT || SCM_USE_RATIONAL || SCM_USE_REAL || SCM_USE_COMPLEX) use_number="no" if test "x$use_int" = xyes; then use_number="yes" fi if test "x$use_rational" = xyes; then use_number="yes" fi if test "x$use_real" = xyes; then use_number="yes" fi if test "x$use_complex" = xyes; then use_number="yes" fi AM_CONDITIONAL(USE_NUMBER, test "x$use_number" = xyes) if test "x$use_number" = xyes; then AC_DEFINE(SCM_USE_NUMBER, 1, [use number]) fi # SCM_USE_FORMAT # if (SCM_USE_SRFI28 || SCM_USE_SRFI48 # || SCM_USE_SSCM_FORMAT_EXTENSION || SCM_USE_RAW_C_FORMAT) use_format="no" if test "x$use_srfi28" = xyes; then use_format="yes" fi if test "x$use_srfi48" = xyes; then use_format="yes" fi if test "x$use_sscm_format_extension" = xyes; then use_format="yes" fi if test "x$use_raw_c_format" = xyes; then use_format="yes" fi AM_CONDITIONAL(USE_FORMAT, test "x$use_format" = xyes) if test "x$use_format" = xyes; then AC_DEFINE(SCM_USE_FORMAT, 1, [use format]) fi #------------------------------------------------------------------------------ # Debug #------------------------------------------------------------------------------ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), [ CFLAGS="$CFLAGS -g" AC_DEFINE(SCM_DEBUG, 1, [enable debugging mode]) enable_debug="yes" ], [ CFLAGS="$CFLAGS -O2" enable_debug="no" ]) # This include guard is required to prevent being overridden by # system-installed config.h on a source that is compiled on # !SCM_COMPILING_LIBSSCM such as test-c/test_*.c. AH_TOP([#ifndef __SIGSCHEME_CONFIG_H #define __SIGSCHEME_CONFIG_H]) # FIXME: temporary solution AH_BOTTOM([ /* FIXME: temporary solution */ #include "config-old.h" #endif /* __SIGSCHEME_CONFIG_H */]) echo "--------------------------------------" echo "| SigScheme Configuration |" echo "--------------------------------------" echo "cflags: '$CFLAGS'" echo "configuration: '$enable_configuration'" echo "encoding: '$enable_multibyte'" echo "debug: '$enable_debug'" AC_CONFIG_FILES([Makefile doc/Makefile m4/Makefile tools/Makefile include/Makefile include/sigscheme/Makefile src/Makefile lib/Makefile test/Makefile test-c/Makefile test-c2/Makefile test-c2/collect.sh bench/Makefile]) AC_SUBST(GSED) AC_SUBST(docdir) AC_SUBST(htmldir) AC_SUBST(objdir) AC_OUTPUT