Fix help of yosys-config.in and provide backward compatibility

This commit is contained in:
Roland Coeurjoly 2024-02-25 18:48:21 +01:00
parent cf7b6c66f0
commit 5fa609b6bf
1 changed files with 10 additions and 4 deletions

View File

@ -9,8 +9,10 @@ help() {
echo "Replacement args:"
echo " --cxx @CXX@"
echo " --cxxflags $( echo '@CXXFLAGS@' | fmt -w60 | sed ':a;N;$!ba;s/\n/ \\\n /g' )"
echo " --ldflags @LINKFLAGS@"
echo " --ldlibs @LIBS@"
echo " --linkflags @LINKFLAGS@"
echo " --ldflags (alias of --linkflags)"
echo " --libs @LIBS@"
echo " --ldlibs (alias of --libs)"
echo " --bindir @BINDIR@"
echo " --datdir @DATDIR@"
echo ""
@ -18,7 +20,7 @@ help() {
echo ""
echo "Use --exec to call a command instead of generating output. Example usage:"
echo ""
echo " $0 --exec --cxx --cxxflags --ldflags -o plugin.so -shared plugin.cc --ldlibs"
echo " $0 --exec --cxx --cxxflags --ldflags -o plugin.so -shared plugin.cc --libs"
echo ""
echo "The above command can be abbreviated as:"
echo ""
@ -44,7 +46,7 @@ fi
if [ "$1" == "--build" ]; then
modname="$2"; shift 2
set -- --exec --cxx --cxxflags --ldflags -o "$modname" -shared "$@" --ldlibs
set -- --exec --cxx --cxxflags --ldflags -o "$modname" -shared "$@" --libs
fi
prefix="--"
@ -63,6 +65,10 @@ for opt; do
tokens=( "${tokens[@]}" @CXX@ ) ;;
"$prefix"cxxflags)
tokens=( "${tokens[@]}" @CXXFLAGS@ ) ;;
"$prefix"linkflags)
tokens=( "${tokens[@]}" @LINKFLAGS@ ) ;;
"$prefix"libs)
tokens=( "${tokens[@]}" @LIBS@ ) ;;
"$prefix"ldflags)
tokens=( "${tokens[@]}" @LINKFLAGS@ ) ;;
"$prefix"ldlibs)