]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
1999-06-20 Mark Elbrecht <snowball3@bigfoot.com>
authorTom Tromey <tromey@redhat.com>
Sun, 20 Jun 1999 10:40:26 +0000 (10:40 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 20 Jun 1999 10:40:26 +0000 (10:40 +0000)
* ylwrap: Handle filenames output by the DOS version of Bison.

ChangeLog
lib/ylwrap
ylwrap

index b683b177bda4f33e29954f9af541da7ae52ce738..ffd51295cd7def8b6689bc68934e1429e88fddde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1999-06-20 Mark Elbrecht <snowball3@bigfoot.com>
+
+       * ylwrap: Handle filenames output by the DOS version of Bison.
+
 1999-06-20  Tom Tromey  <tromey@cygnus.com>
 
        * ylwrap: Be less strict when recognizing DOS paths.  From Mark
index 6a9b615d748c77420b45443756a9634e70ebf8b4..467fd66097e04362719674ad0e6cd498da3e2125 100755 (executable)
@@ -90,15 +90,34 @@ if test $status -eq 0; then
    set X $pairlist
    shift
    first=yes
+   # Since DOS filename conventions don't allow two dots,
+   # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+   # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+   y_tab_nodot="no"
+   if test -f y_tab.c || test -f y_tab.h; then
+      y_tab_nodot="yes"
+   fi
+
    while test "$#" -ne 0; do
-      if test -f "$1"; then
+      from="$1"
+      # Handle y_tab.c and y_tab.h output by DOS
+      if test $y_tab_nodot = "yes"; then
+        if test $from = "y.tab.c"; then
+           from="y_tab.c"
+        else
+           if test $from = "y.tab.h"; then
+              from="y_tab.h"
+           fi
+        fi
+      fi
+      if test -f "$from"; then
          # If $2 is an absolute path name, then just use that,
          # otherwise prepend `../'.
          case "$2" in
           /* | [A-Za-z]:*) target="$2";;
           *) target="../$2";;
         esac
-        mv "$1" "$target" || status=$?
+        mv "$from" "$target" || status=$?
       else
         # A missing file is only an error for the first file.  This
         # is a blatant hack to let us support using "yacc -d".  If -d
diff --git a/ylwrap b/ylwrap
index 6a9b615d748c77420b45443756a9634e70ebf8b4..467fd66097e04362719674ad0e6cd498da3e2125 100755 (executable)
--- a/ylwrap
+++ b/ylwrap
@@ -90,15 +90,34 @@ if test $status -eq 0; then
    set X $pairlist
    shift
    first=yes
+   # Since DOS filename conventions don't allow two dots,
+   # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+   # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+   y_tab_nodot="no"
+   if test -f y_tab.c || test -f y_tab.h; then
+      y_tab_nodot="yes"
+   fi
+
    while test "$#" -ne 0; do
-      if test -f "$1"; then
+      from="$1"
+      # Handle y_tab.c and y_tab.h output by DOS
+      if test $y_tab_nodot = "yes"; then
+        if test $from = "y.tab.c"; then
+           from="y_tab.c"
+        else
+           if test $from = "y.tab.h"; then
+              from="y_tab.h"
+           fi
+        fi
+      fi
+      if test -f "$from"; then
          # If $2 is an absolute path name, then just use that,
          # otherwise prepend `../'.
          case "$2" in
           /* | [A-Za-z]:*) target="$2";;
           *) target="../$2";;
         esac
-        mv "$1" "$target" || status=$?
+        mv "$from" "$target" || status=$?
       else
         # A missing file is only an error for the first file.  This
         # is a blatant hack to let us support using "yacc -d".  If -d