0

I'm having an issue while building packages from source using scons. I'm getting the below exception. If I change the file extension to ll or lm I get syntax errors while it compiles.

scons -j ${JOBS_COUNT:-$(grep -c processor /proc/cpuinfo || echo 1)} --without-dpdk

scons: Reading SConscript files ...
('Ubuntu', '20.04', 'focal')
('Ubuntu', '20.04', 'focal')
('Ubuntu', '20.04', 'focal')

scons: *** While building `['sandeshy.cc']' from `['/root/salim/src/contrail-common/sandesh/compiler/sandeshy.yy']': Don't know how to build from a source file with suffix `.yy'.  Expected a suffix in this list: ['.lm', '.ll'].

Sconscript file

# -*- mode: python; -*-
  
#
# Created by Megh Bhatt on 07/16/12.
# Copyright (c) 2012 Contrail Systems. All rights reserved.
#

Import('SandeshEnv')

env = SandeshEnv.Clone();

rmflags = ['-Wsign-compare', '-Werror', '-fno-exceptions',
           '--coverage']

cflags = env['CCFLAGS']
for flag in rmflags:
    if flag in cflags:
        cflags.remove(flag)

env['CCFLAGS'] = cflags

env.Append(CPPPATH = ['#src/contrail-common/sandesh/compiler','#build/include'])

# Lex and Yacc
env.Append(YACCFLAGS = '-d')
env['YACCHXXFILESUFFIX'] = '.hh'
#env.Append(LEXFLAGS = '-DSANDESH')
env.CXXFile(target = 'sandeshy.cc', source = 'sandeshy.yy')
env.CXXFile(target = 'sandeshl.cc', source = 'sandeshl.ll')

sandesh = env.Program(target = 'sandesh',
                      source = ['main.cc',
                                'md5.c',
                                'sandeshy.cc',
                                'sandeshl.cc',
                                'generate/t_cpp_generator.cc',
                                'generate/t_html_generator.cc',
                                'generate/t_generator.cc',
                                'generate/t_xsd_generator.cc',
                                'generate/t_c_generator.cc',
                                'generate/t_py_generator.cc',
                                'generate/t_doc_generator.cc',
                                'parse/parse.cc',
                               ])
env.Install(env['TOP_BIN'], sandesh)

I am trying to build packages from opencontrail source files which is got from github repo

sandeshy.yy file located in github repo

Amy
  • 1,114
  • 13
  • 35
salim ep
  • 35
  • 5

1 Answers1

-1

You need to install yacc to fix this error, scons is presumably checking what it is able to process, as it can't process yacc files it doesn't add .yy to the list of supported extensions for CXXFile

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60