From 017e4b69900445e101a02f21e6d3438992fdd43b Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 16 May 2024 23:28:29 +0900 Subject: [PATCH] Add feature for architecture. Issue #955. --- Makefile | 1 + Makefile.detect | 4 ++++ sexp.c | 1 + 3 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index d62915dc..e2bed677 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,7 @@ include/chibi/install.h: Makefile.libs Makefile.detect echo '#define sexp_so_extension "'$(SO)'"' > $@ echo '#define sexp_default_module_path "'$(MODDIR):$(BINMODDIR):$(SNOWMODDIR):$(SNOWBINMODDIR)'"' >> $@ echo '#define sexp_platform "'$(PLATFORM)'"' >> $@ + echo '#define sexp_architecture "'$(ARCH)'"' >> $@ echo '#define sexp_version "'$(CHIBI_VERSION)'"' >> $@ echo '#define sexp_release_name "'`cat RELEASE`'"' >> $@ diff --git a/Makefile.detect b/Makefile.detect index 73d8cd7c..9ec850cb 100644 --- a/Makefile.detect +++ b/Makefile.detect @@ -52,6 +52,10 @@ endif endif endif +ifndef ARCH +ARCH = $(shell uname -m) +endif + ######################################################################## # Set default variables for the platform. diff --git a/sexp.c b/sexp.c index a886513c..09bbb5ac 100644 --- a/sexp.c +++ b/sexp.c @@ -460,6 +460,7 @@ sexp sexp_finalize_c_type (sexp ctx, sexp self, sexp_sint_t n, sexp obj) { /****************************** contexts ******************************/ static const char* sexp_initial_features[] = { + sexp_architecture, sexp_platform, #if SEXP_BSD "bsd",