Moved yosys-config.in to misc/
authorClifford Wolf <clifford@clifford.at>
Sat, 18 Oct 2014 12:15:05 +0000 (14:15 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 18 Oct 2014 12:15:05 +0000 (14:15 +0200)
Makefile
misc/yosys-config.in [new file with mode: 0644]
yosys-config.in [deleted file]

index 75af44659cb3766b12e327fa19c8f26ef5a5f11c..c2d1ac0b264f033a06af2ba60360239398a6f062 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -224,9 +224,9 @@ kernel/version_$(GIT_REV).cc: Makefile
        $(Q) echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys $(YOSYS_VER) (git sha1 $(GIT_REV), $(notdir $(CXX)) ` \
                        $(CXX) --version | tr ' ()' '\n' | grep '^[0-9]' | head -n1` $(filter -f% -m% -O% -DNDEBUG,$(CXXFLAGS)))\"; }" > kernel/version_$(GIT_REV).cc
 
-yosys-config: yosys-config.in
+yosys-config: misc/yosys-config.in
        $(P) $(SED) -e 's,@CXX@,$(CXX),;' -e 's,@CXXFLAGS@,$(CXXFLAGS),;' -e 's,@LDFLAGS@,$(LDFLAGS),;' -e 's,@LDLIBS@,$(LDLIBS),;' \
-                       -e 's,@BINDIR@,$(DESTDIR)/bin,;' -e 's,@DATDIR@,$(DESTDIR)/share/yosys,;' < yosys-config.in > yosys-config
+                       -e 's,@BINDIR@,$(DESTDIR)/bin,;' -e 's,@DATDIR@,$(DESTDIR)/share/yosys,;' < misc/yosys-config.in > yosys-config
        $(Q) chmod +x yosys-config
 
 abc/abc-$(ABCREV)$(EXE):
diff --git a/misc/yosys-config.in b/misc/yosys-config.in
new file mode 100644 (file)
index 0000000..8f8dd06
--- /dev/null
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+help() {
+       {
+               echo ""
+               echo "Usage: $0 [-exec] [--prefix pf] args.."
+               echo ""
+               echo "Replecement args:"
+               echo "    --cxx         @CXX@"
+               echo "    --cxxflags    $( echo '@CXXFLAGS@' | fmt -w60 | sed ':a;N;$!ba;s/\n/ \\\n                      /g' )"
+               echo "    --ldflags     @LDFLAGS@"
+               echo "    --ldlibs      @LDLIBS@"
+               echo "    --bindir      @BINDIR@"
+               echo "    --datdir      @DATDIR@"
+               echo ""
+               echo "All other args are passed trhough as they are."
+               echo ""
+               echo "Use -exec to call a command instead of generating output. Example usage:"
+               echo ""
+               echo "  yosys-config --exec --cxx --cxxflags --ldflags -o plugin.so -shared plugin.cc --ldlibs"
+               echo ""
+               echo "Use --prefix to change the prefix for the special args from '--' to"
+               echo "something else. Example:"
+               echo ""
+               echo "  yosys-config --prefix @ bindir: @bindir"
+               echo ""
+               echo "The args --bindir and --datdir can be directly followed by a slash and"
+               echo "additional text. Example:"
+               echo ""
+               echo "  yosys-config --datdir/simlib.v"
+               echo ""
+       } >&2
+       exit 1
+}
+
+if [ $# -eq 0 ]; then
+       help
+fi
+
+prefix="--"
+get_prefix=false
+exec_mode=false
+declare -a tokens=()
+
+for opt; do
+       if $get_prefix; then
+               prefix="$opt"
+               get_prefix=false
+               continue
+       fi
+       case "$opt" in
+               "$prefix"cxx)
+                       tokens=( "${tokens[@]}"  @CXX@       ) ;;
+               "$prefix"cxxflags)
+                       tokens=( "${tokens[@]}"  @CXXFLAGS@  ) ;;
+               "$prefix"ldflags)
+                       tokens=( "${tokens[@]}"  @LDFLAGS@   ) ;;
+               "$prefix"ldlibs)
+                       tokens=( "${tokens[@]}"  @LDLIBS@    ) ;;
+               "$prefix"bindir)
+                       tokens=( "${tokens[@]}" '@BINDIR@'   ) ;;
+               "$prefix"datdir)
+                       tokens=( "${tokens[@]}" '@DATDIR@'   ) ;;
+               "$prefix"bindir/*)
+                       tokens=( "${tokens[@]}" '@BINDIR@'"${opt#${prefix}bindir}" ) ;;
+               "$prefix"datdir/*)
+                       tokens=( "${tokens[@]}" '@DATDIR@'"${opt#${prefix}datdir}" ) ;;
+               --help|-\?|-h)
+                       if [ ${#tokens[@]} -eq 0 ]; then
+                               help
+                       else
+                               tokens=( "${tokens[@]}" "$opt" )
+                       fi ;;
+               --exec)
+                       if [ ${#tokens[@]} -eq 0 ]; then
+                               exec_mode=true
+                       else
+                               tokens=( "${tokens[@]}" "$opt" )
+                       fi ;;
+               --prefix)
+                       if [ ${#tokens[@]} -eq 0 ]; then
+                               get_prefix=true
+                       else
+                               tokens=( "${tokens[@]}" "$opt" )
+                       fi ;;
+               *)
+                       tokens=( "${tokens[@]}" "$opt" )
+       esac
+done
+
+if $exec_mode; then
+       exec "${tokens[@]}"
+fi
+
+echo "${tokens[@]}"
+exit 0
+
diff --git a/yosys-config.in b/yosys-config.in
deleted file mode 100644 (file)
index 8f8dd06..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash
-
-help() {
-       {
-               echo ""
-               echo "Usage: $0 [-exec] [--prefix pf] args.."
-               echo ""
-               echo "Replecement args:"
-               echo "    --cxx         @CXX@"
-               echo "    --cxxflags    $( echo '@CXXFLAGS@' | fmt -w60 | sed ':a;N;$!ba;s/\n/ \\\n                      /g' )"
-               echo "    --ldflags     @LDFLAGS@"
-               echo "    --ldlibs      @LDLIBS@"
-               echo "    --bindir      @BINDIR@"
-               echo "    --datdir      @DATDIR@"
-               echo ""
-               echo "All other args are passed trhough as they are."
-               echo ""
-               echo "Use -exec to call a command instead of generating output. Example usage:"
-               echo ""
-               echo "  yosys-config --exec --cxx --cxxflags --ldflags -o plugin.so -shared plugin.cc --ldlibs"
-               echo ""
-               echo "Use --prefix to change the prefix for the special args from '--' to"
-               echo "something else. Example:"
-               echo ""
-               echo "  yosys-config --prefix @ bindir: @bindir"
-               echo ""
-               echo "The args --bindir and --datdir can be directly followed by a slash and"
-               echo "additional text. Example:"
-               echo ""
-               echo "  yosys-config --datdir/simlib.v"
-               echo ""
-       } >&2
-       exit 1
-}
-
-if [ $# -eq 0 ]; then
-       help
-fi
-
-prefix="--"
-get_prefix=false
-exec_mode=false
-declare -a tokens=()
-
-for opt; do
-       if $get_prefix; then
-               prefix="$opt"
-               get_prefix=false
-               continue
-       fi
-       case "$opt" in
-               "$prefix"cxx)
-                       tokens=( "${tokens[@]}"  @CXX@       ) ;;
-               "$prefix"cxxflags)
-                       tokens=( "${tokens[@]}"  @CXXFLAGS@  ) ;;
-               "$prefix"ldflags)
-                       tokens=( "${tokens[@]}"  @LDFLAGS@   ) ;;
-               "$prefix"ldlibs)
-                       tokens=( "${tokens[@]}"  @LDLIBS@    ) ;;
-               "$prefix"bindir)
-                       tokens=( "${tokens[@]}" '@BINDIR@'   ) ;;
-               "$prefix"datdir)
-                       tokens=( "${tokens[@]}" '@DATDIR@'   ) ;;
-               "$prefix"bindir/*)
-                       tokens=( "${tokens[@]}" '@BINDIR@'"${opt#${prefix}bindir}" ) ;;
-               "$prefix"datdir/*)
-                       tokens=( "${tokens[@]}" '@DATDIR@'"${opt#${prefix}datdir}" ) ;;
-               --help|-\?|-h)
-                       if [ ${#tokens[@]} -eq 0 ]; then
-                               help
-                       else
-                               tokens=( "${tokens[@]}" "$opt" )
-                       fi ;;
-               --exec)
-                       if [ ${#tokens[@]} -eq 0 ]; then
-                               exec_mode=true
-                       else
-                               tokens=( "${tokens[@]}" "$opt" )
-                       fi ;;
-               --prefix)
-                       if [ ${#tokens[@]} -eq 0 ]; then
-                               get_prefix=true
-                       else
-                               tokens=( "${tokens[@]}" "$opt" )
-                       fi ;;
-               *)
-                       tokens=( "${tokens[@]}" "$opt" )
-       esac
-done
-
-if $exec_mode; then
-       exec "${tokens[@]}"
-fi
-
-echo "${tokens[@]}"
-exit 0
-