Browse Source

Replace another bison patch with environment variable
038ae732c509e3b2c4b4fc745092e090378ab5a2

thegeorg 7 months ago
parent
commit
21990649bf
2 changed files with 1 additions and 10 deletions
  1. 1 1
      build/conf/bison_lex.conf
  2. 0 9
      contrib/tools/bison/src/files.c

+ 1 - 1
build/conf/bison_lex.conf

@@ -135,7 +135,7 @@ macro USE_OLD_FLEX() {
 
 macro _SRC("y", SRC, SRCFLAGS...) {
     .PEERDIR=build/induced/by_bison
-    .CMD=${tool:"contrib/tools/bison"} $BISON_FLAGS ${env:"M4=${tool:M4_PATH}"} $_BISON_HEADER ${hide:_BISON_GEN_EXT} -o ${nopath;output;suf=$_BISON_GEN_EXT:SRC} ${input:SRC} ${SRCFLAGS} ${kv;hide:"p YC"} ${kv;hide:"pc light-green"} && $_BISON_PP
+    .CMD=${tool:"contrib/tools/bison"} $BISON_FLAGS ${env:"M4=${tool:M4_PATH}"} ${env:"BISON_PKGDATADIR=${ARCADIA_ROOT}/${_BISON_DATA_DIR}"} $_BISON_HEADER ${hide:_BISON_GEN_EXT} -o ${nopath;output;suf=$_BISON_GEN_EXT:SRC} ${input:SRC} ${SRCFLAGS} ${kv;hide:"p YC"} ${kv;hide:"pc light-green"} && $_BISON_PP
     .SEM=target_bison_parser PRIVATE ${input:SRC} ${output;nopath;noext;hide;suf=${OBJ_SUF}.o:SRC} ${nopath;noext;output;hide:SRC.h} ${nopath;noext;output;addincl;hide:SRC.h} && set_global_flags BISON_FLAGS $BISON_FLAGS && conan_require_tool m4/1.4.19 && conan_import '"bin, m4* -> ./bin/m4/bin"' && conan_require_tool bison/3.8.2 && conan_import '"bin, bison* -> ./bin/bison/bin"' && conan_import '"res, * -> ./bin/bison/res"' && target_macroses-ITEM && target_macroses-macro target_bison_parser && target_macroses-args PRIVATE ${input:SRC} ${output;nopath;noext;hide;suf=${OBJ_SUF}.o:SRC} ${nopath;noext;output;hide:SRC.h} ${nopath;noext;output;addincl;hide:SRC.h} && platform_vars-BISON_FLAGS ${quo:BISON_FLAGS} && conan-tool_requires m4/1.4.19 && conan-imports 'bin, m4* -> ./bin/m4/bin' && conan-tool_requires bison/3.8.2 && conan-imports 'bin, bison* -> ./bin/bison/bin' && conan-imports 'res, * -> ./bin/bison/res'
 }
 

+ 0 - 9
contrib/tools/bison/src/files.c

@@ -419,18 +419,9 @@ unlink_generated_sources (void)
 /* Memory allocated by relocate2, to free.  */
 static char *relocate_buffer = NULL;
 
-#include "uniqstr.h"
-#include <contrib/tools/bison/arcadia_root.h>
-#define STR(a) XSTR(a)
-#define XSTR(a) #a
 char const *
 pkgdatadir (void)
 {
-  const char* arc_path  = getenv("ARCADIA_ROOT_DISTBUILD");
-  if (arc_path == NULL)
-    arc_path = ArcadiaRoot();
-  return uniqstr_concat(3, arc_path, "/", STR(BISON_DATA_DIR));
-  
   if (relocate_buffer)
     return relocate_buffer;
   else