From 6dac070aa2aca748917b6cc44dc28c29f5558e52 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 9 Oct 2024 22:41:01 +0900 Subject: [PATCH] Add `--with-parser` configure option --- configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index d099b62679..ca578f8e9f 100644 --- a/configure.ac +++ b/configure.ac @@ -4560,6 +4560,17 @@ AS_IF([test x"$enable_rubygems" = xno], [ ]) AC_SUBST(USE_RUBYGEMS) +m4_define(available_parsers, [parse.y, prism]) +with_parser=prism +AC_ARG_WITH(parser, + AS_HELP_STRING([--with-parser=PARSER], + [specify default parser; PARSER is one of ]m4_join([, ],available_parsers))) +AS_CASE([$with_parser], +m4_foreach(parser, [available_parsers], + parser[,][AC_DEFINE_UNQUOTED(RB_DEFAULT_PARSER, RB_DEFAULT_PARSER_[]AS_TR_CPP(parser)),]) + [AC_MSG_ERROR([Unknown parser: $with_parser])] +) + arch_hdrdir="${EXTOUT}/include/${arch}/ruby" AS_MKDIR_P("${arch_hdrdir}") config_h="${arch_hdrdir}/config.h"