From a9f5c072fd859fd9f6442899685d0f821d382664 Mon Sep 17 00:00:00 2001 From: Chris White Date: Sun, 25 Apr 2021 19:21:12 -0400 Subject: [PATCH] configure: Add --enable-meta, --disable-random [WIP] For #5. Needs to be tested. --- configure.ac | 10 ++++++++++ wren-pkg/Makefile.am | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/configure.ac b/configure.ac index db327a4..723874c 100644 --- a/configure.ac +++ b/configure.ac @@ -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..4483dab 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,22 @@ 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) +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) +endif + # === Other Wren files ================================================== EXTRA_DIST += \ @@ -63,4 +84,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)