diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-09 22:25:51 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-09 22:25:51 -0800 |
commit | 236a20e92316535bc75dde63d51431875e253bfb (patch) | |
tree | 6ec4fb84a27cb311027495db9d3c34b791fe207e /Makefile | |
parent | b1088a2502cba1a61b862f708489c8d4baa722fe (diff) | |
download | txr-236a20e92316535bc75dde63d51431875e253bfb.tar.gz txr-236a20e92316535bc75dde63d51431875e253bfb.tar.bz2 txr-236a20e92316535bc75dde63d51431875e253bfb.zip |
Bignum support, here we go!
Bignums, based on Michael Fromberger's MPI library, are integrated
into the input syntax, stream output, equality testing, the garbage
collector, and hashing.
The plus operation handles transitions between fixnums and bignums.
Other operations are still fixnum only.
* Makefile (CFLAGS): Add mpi directory to include file search.
(OBJS): Include new arith.o module and all of MPI_OBJS.
(MPI_OBJS, MPI_OBJS_BASE): New variables.
* configure (mpi_version, have_quilt, have_patch): New variables.
Script detects whether patch and quilt are available. Unpacks
mpi library, applies patches. Detects 128 bit integer type.
Records more information in config.h about the sizes of types.
* dep.mk: Updated.
* depend.txr: Make work with paths that have directory components.
* eval.c (eval_init): Rename of nump to fixnump.
* gc.c (finalize, mark_obj): Handle BGNUM case.
* hash.c: (hash_c_str): Changed to return unsigned long
instead of long.
(equal_hash): Handle BGNUM case.
(eql_hash): Handle bignums with equal-hash, but other
objects as eq.
* lib.c (num_s): Variable renamed to fixnum_s.
(bignum_s): New symbol variable.
(code2type): Follow rename of num_s. Handle BGNUM case.
(typeof): Follow rename of num_s.
(eql): Handle bignums using equal, and other types using eq.
(equal): Handle BGNUM case.
(chk_calloc): New function.
(c_num): Wording change in error message: is not a fixnum.
(nump): Renamed to fixnump.
(bignump): New function.
(plus): Function removed, reimplemented in arith.c.
(int_str): Handle integers which are too large for wcstol
using bignum conversion. Base 0 is no longer passed to
wcstol but converted to 10 because the special semantics
for 0 would be inconsistent for bignums.
(obj_init): Follow rename of num_s. Initialize bignum_s.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -30,14 +30,23 @@ include config.make CFLAGS := -I. -I$(top_srcdir) $(LANG_FLAGS) $(DIAG_FLAGS) \ $(OPT_FLAGS) $(DBG_FLAGS) $(PLATFORM_FLAGS) +CFLAGS += -I$(top_srcdir)/mpi-$(mpi_version) CFLAGS := $(filter-out $(REMOVE_FLAGS),$(CFLAGS)) ifneq ($(subst g++,@,$(notdir $(CC))),$(notdir $(CC))) CFLAGS := $(filter-out -Wmissing-prototypes -Wstrict-prototypes,$(CFLAGS)) endif +# TXR objects OBJS := txr.o lex.yy.o y.tab.o match.o lib.o regex.o gc.o unwind.o stream.o -OBJS += hash.o utf8.o filter.o debug.o eval.o +OBJS += arith.o hash.o utf8.o filter.o debug.o eval.o + +# MPI objects +MPI_OBJ_BASE=mpi.o mplogic.o + +MPI_OBJS := $(addprefix mpi-$(mpi_version)/,$(MPI_OBJ_BASE)) + +OBJS += $(MPI_OBJS) PROG := ./txr @@ -58,6 +67,9 @@ y.tab.c y.tab.h: parser.y # Bison-generated parser also tests for this lint define. y.tab.o: CFLAGS += -Dlint +$(MPI_OBJS): CFLAGS += -DXMALLOC=chk_malloc -DXREALLOC=chk_realloc +$(MPI_OBJS): CFLAGS += -DXCALLOC=chk_calloc -DXFREE=free + .PHONY: rebuild rebuild: clean $(PROG) |