From ec323da61414a83b3109945f885129963e0a7329 Mon Sep 17 00:00:00 2001 From: Hayodea Hakol Date: Mon, 6 Jan 2025 20:59:45 -0400 Subject: [PATCH] Build:m4: Add AC_PROG_[FLEX/BISON] from the MESA source code. --- m4/ac_prog_bison.m4 | 18 ++++++++++++++++++ m4/ac_prog_flex.m4 | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 m4/ac_prog_bison.m4 create mode 100644 m4/ac_prog_flex.m4 diff --git a/m4/ac_prog_bison.m4 b/m4/ac_prog_bison.m4 new file mode 100644 index 0000000..e0f5088 --- /dev/null +++ b/m4/ac_prog_bison.m4 @@ -0,0 +1,18 @@ +# This script was snagged from the MESA project, which uses an MIT license. + +# +# Check for Bison. +# +# This macro verifies that Bison is installed. If successful, then +# 1) YACC is set to bison -y (to emulate YACC calls) +# 2) BISON is set to bison +# +AC_DEFUN([AC_PROG_BISON], + [AC_PROG_YACC() + if test "$YACC" != "bison -y"; then + AC_SUBST(BISON,[]) + AC_MSG_WARN([bison not found]) + else + AC_SUBST(BISON,[bison]) + fi +]) diff --git a/m4/ac_prog_flex.m4 b/m4/ac_prog_flex.m4 new file mode 100644 index 0000000..41b1b45 --- /dev/null +++ b/m4/ac_prog_flex.m4 @@ -0,0 +1,18 @@ +# This script was snagged from the MESA project, which uses an MIT license. + +# +# Check for FLEX. +# +# This macro verifies that flex is installed. If successful, then +# 1) LEX is set to flex (to emulate lex calls) +# 2) FLEX is set to flex +# +AC_DEFUN([AC_PROG_FLEX], [ + AC_PROG_LEX(noyywrap) + if test "$LEX" != "flex"; then + AC_SUBST(FLEX,[]) + AC_MSG_ERROR([flex not found]) + else + AC_SUBST(FLEX,[flex]) + fi +])