Merge pull request #1973 from YosysHQ/eddie/fix1966

tests: fix various/plugin.sh when PREFIX != /usr/local/share
This commit is contained in:
Eddie Hung 2020-04-22 10:19:30 -07:00 committed by GitHub
commit db27f2f378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@ help() {
echo "Usage: $0 [--exec] [--prefix pf] args.." echo "Usage: $0 [--exec] [--prefix pf] args.."
echo " $0 --build modname.so cppsources.." echo " $0 --build modname.so cppsources.."
echo "" echo ""
echo "Replecement args:" echo "Replacement args:"
echo " --cxx @CXX@" echo " --cxx @CXX@"
echo " --cxxflags $( echo '@CXXFLAGS@' | fmt -w60 | sed ':a;N;$!ba;s/\n/ \\\n /g' )" echo " --cxxflags $( echo '@CXXFLAGS@' | fmt -w60 | sed ':a;N;$!ba;s/\n/ \\\n /g' )"
echo " --ldflags @LDFLAGS@" echo " --ldflags @LDFLAGS@"

View File

@ -1,6 +1,8 @@
set -e set -e
rm -f plugin.so rm -f plugin.so
CXXFLAGS=$(../../yosys-config --cxxflags) CXXFLAGS=$(../../yosys-config --cxxflags)
CXXFLAGS=${CXXFLAGS// -I\/usr\/local\/share\/yosys\/include/ -I..\/..\/share\/include} DATDIR=$(../../yosys-config --datdir)
DATDIR=${DATDIR//\//\\\/}
CXXFLAGS=${CXXFLAGS//$DATDIR/..\/..\/share}
../../yosys-config --exec --cxx ${CXXFLAGS} --ldflags -shared -o plugin.so plugin.cc ../../yosys-config --exec --cxx ${CXXFLAGS} --ldflags -shared -o plugin.so plugin.cc
../../yosys -m ./plugin.so -p "test" | grep -q "Plugin test passed!" ../../yosys -m ./plugin.so -p "test" | grep -q "Plugin test passed!"