Skip to content

Commit

Permalink
Fix help of yosys-config.in and provide backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
RCoeurjoly committed Feb 25, 2024
1 parent cf7b6c6 commit 5fa609b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions misc/yosys-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ 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 ""
echo "All other args are passed through as they are."
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 ""
Expand All @@ -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="--"
Expand All @@ -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)
Expand Down

0 comments on commit 5fa609b

Please sign in to comment.