From 6760b33a75c8fb8b04f4f9d7bb7d2e7d2a24e956 Mon Sep 17 00:00:00 2001 From: Chris White Date: Sun, 25 Apr 2021 20:41:25 -0400 Subject: [PATCH] configure: Add --enable-meta, --disable-random [WIP] For #5. Needs to be tested. Also, bump version. --- configure.ac | 12 +++++++++++- wren-pkg/Makefile.am | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7638805..723874c 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ dnl === Basic setup ======================================================= dnl Note: the version number of this package matches the version of Wren in dnl the first three digits. AC_INIT([Vala bindings for Wren], - [0.4.0.1], + [0.4.0.2], [https://github.com/cxw42/wren-vala/issues], [wren-vala], [https://github.com/cxw42/wren-vala]) @@ -69,6 +69,16 @@ AC_SEARCH_LIBS([log2], [m], ] ) +dnl Wren class Meta (default disabled) +AC_ARG_ENABLE([meta], + AS_HELP_STRING([--enable-meta], [Enable the Wren "Meta" class (default disabled)])) +AM_CONDITIONAL([USE_WREN_META], [test "x$enable_meta" = "xyes"]) + +dnl Wren class Random (default enabled) +AC_ARG_ENABLE([random], + AS_HELP_STRING([--disable-random], [Disable the Wren "Random" class (default enabled)])) +AM_CONDITIONAL([USE_WREN_RANDOM], [test "x$enable_random" != "xno"]) + dnl === Code coverage ===================================================== dnl For some reason, the coverage data is referring to src/.../glib-2.0.vapi. diff --git a/wren-pkg/Makefile.am b/wren-pkg/Makefile.am index 10bf4f3..0d31318 100644 --- a/wren-pkg/Makefile.am +++ b/wren-pkg/Makefile.am @@ -48,6 +48,11 @@ libwren_@APIVER@_la_SOURCES = \ wren/src/vm/wren_value.h \ wren/src/vm/wren_vm.c \ wren/src/vm/wren_vm.h \ + $(EOL) + +# --- Meta and Random --- + +EXTRA_libwren_@APIVER@_la_SOURCES = \ wren/src/optional/wren_opt_meta.c \ wren/src/optional/wren_opt_meta.h \ wren/src/optional/wren_opt_meta.wren.inc \ @@ -56,6 +61,26 @@ libwren_@APIVER@_la_SOURCES = \ wren/src/optional/wren_opt_random.wren.inc \ $(EOL) +if USE_WREN_META +libwren_@APIVER@_la_SOURCES += \ + wren/src/optional/wren_opt_meta.c \ + wren/src/optional/wren_opt_meta.h \ + wren/src/optional/wren_opt_meta.wren.inc \ + $(EOL) +else +libwren_@APIVER@_la_CFLAGS += -DWREN_OPT_META=0 +endif + +if USE_WREN_RANDOM +libwren_@APIVER@_la_SOURCES += \ + wren/src/optional/wren_opt_random.c \ + wren/src/optional/wren_opt_random.h \ + wren/src/optional/wren_opt_random.wren.inc \ + $(EOL) +else +libwren_@APIVER@_la_CFLAGS += -DWREN_OPT_RANDOM=0 +endif + # === Other Wren files ================================================== EXTRA_DIST += \ @@ -63,4 +88,6 @@ EXTRA_DIST += \ wren/CHANGELOG.md \ wren/LICENSE \ wren/README.md \ + wren/src/optional/wren_opt_meta.wren \ + wren/src/optional/wren_opt_random.wren \ $(EOL)