grap, anybody?

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Tue Jan 7 06:17:00 GMT 2020


On 2020-01-06 14:39, bonhard@uklinux.net wrote:
> I have a version of grap, being
> grap 1.42 compiled under CYGWIN_NT-6.1 1.5.25(0.156/4/2)
> compiled (guessing) more than a decade ago. It still works, which is a good
> thing, because if I try to compile the current version
> https://www.lunabase.org/~faber/Vault/software/grap/grap-1.45.tar.gz
> with the current Cygwin provision CYGWIN_NT-10.0-WOW 3.1.2(0.340/5/3) the
> process fails at make, after a successful ./configure.
> However, the executable I have does NOT work under the 64-bit version of
> Cygwin.
> Q1 Can anybody provide a fix to compile grap 1.45 for Cygwin32?
> Q2 Ditto Cygwin64 (or _any_ version of grap that works for Cygwin64)?
> Q3 Failing any hints or pointers for compilation (preferred) can anybody
> please provide a pointer to a grap executable that works for Cygwin64?

Using basic grap.cygport variable definitions, issues are:

$ cygport grap.cygport download all
...
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
bison -y -d grap.yy && rm -f y.tab.c
bison: grap.yy: cannot open: No such file or directory
make: *** [Makefile:995: y.tab.h] Error 1
*** ERROR: make failed

fudged by:

$ cd grap-1.45-1.x86_64/build/
$ llgo grap.yy
lrwxrwxrwx 1 40 Jan 14  2019 grap.yy -> grap-1.45-1.x86_64/src/grap-1.45/grap.yy
$ ln -fs ../src/grap-1.45/grap.yy .
'./grap.yy' -> '../src/grap-1.45/grap.yy'
$ llgo grap.yy
lrwxrwxrwx 1 24 Jan  6 20:55 grap.yy -> ../src/grap-1.45/grap.yy
$ cd ../../

then:

$ cygport grap.cygport compile
...
make[1]: *** No rule to make target 'grap*.defines', needed by 'all-am'.  Stop.
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/grap_draw.Tpo .deps/grap_draw.Po
mv -f .deps/grap_parse.Tpo .deps/grap_parse.Po
mv -f .deps/grap_pic.Tpo .deps/grap_pic.Po
mv -f .deps/grap_tokenizer.Tpo .deps/grap_tokenizer.Po
make[1]: Leaving directory '.../grap-1.45-1.x86_64/build'
make: *** [Makefile:381: all] Error 2
*** ERROR: make failed

because:

$ cd grap-1.45-1.x86_64/src/grap-1.45/
$ fgrep 'dist_defines_DATA = ' Makefile.{am,in}
Makefile.am:dist_defines_DATA = grap*.defines
Makefile.in:dist_defines_DATA = grap*.defines

fudged by:

$ cd grap-1.45-1.x86_64/build/
$ ln -s ../src/grap-1.45/*.defines .
'./grap.defines' -> '../src/grap-1.45/grap.defines'
'./grap.tex.defines' -> '../src/grap-1.45/grap.tex.defines'

retry:

$ cygport grap.cygport compile
...
make[1]: *** No rule to make target 'examples/*.d', needed by 'all-am'.  Stop.
make[1]: *** Waiting for unfinished jobs....
.../grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll: In function ‘int yylex()’:
.../grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll:201:52: warning: comparison
between signed and unsigned integer expressions [-Wsign-compare]
                            for ( unsigned i = 0; i < yyleng; i++ )
                                                  ~~^~~~~~~~
grap.yy: In function ‘int yyparse()’:
grap.yy:582:12: error: ‘strptime’ was not declared in this scope
        if (strptime($5->c_str(), $3->c_str(), &tm) != 0) {
            ^~~~~~~~
grap.yy:582:12: note: suggested alternative: ‘strftime’
        if (strptime($5->c_str(), $3->c_str(), &tm) != 0) {
            ^~~~~~~~
            strftime
.../grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll:725:12: error: ‘strdup’ was not
declared in this scope
  char *c = strdup(yytext);
            ^~~~~~
.../grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll:725:12: note: suggested
alternative: ‘strcmp’
  char *c = strdup(yytext);
            ^~~~~~
            strcmp
grap_lex.cc: In function ‘void yy_init_buffer(YY_BUFFER_STATE, FILE*)’:
grap_lex.cc:3723:48: error: ‘fileno’ was not declared in this scope

                                                ^
grap_lex.cc:3723:48: note: suggested alternative: ‘file’

                                                ^
                                                file
make[1]: *** [Makefile:497: grap.o] Error 1
make[1]: *** [Makefile:497: grap_lex.o] Error 1
make[1]: Leaving directory '.../grap-1.45-1.x86_64/build'
make: *** [Makefile:381: all] Error 2
*** ERROR: make failed

patched with:

--- grap-1.45-1.x86_64/origsrc/grap-1.45/grap.yy        2014-08-24
16:58:06.000000000 -0600
+++ grap-1.45-1.x86_64/src/grap-1.45/grap.yy    2020-01-06 22:38:47.338711700 -0700
@@ -10,6 +10,7 @@
 #include <iostream>
 #include <stack>
 #include <math.h>
+#include <time.h>
 #ifdef STDC_HEADERS
 #include <limits.h>
 #else

--- grap-1.45-1.x86_64/origsrc/grap-1.45/grap_lex.ll    2014-08-24
16:55:34.000000000 -0600
+++ grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll        2020-01-06
22:42:17.566551300 -0700
@@ -20,6 +20,8 @@ extern "C" {
 #include <sys/param.h>
 #include <set>
 #include <map>
+#include <stdio.h>
+#include <string.h>
 #include "grap.h"
 #include "grap_data.h"
 #include "grap_draw.h"

gives:

$ cygport grap.cygport compile
...
make[1]: *** No rule to make target 'examples/*.d', needed by 'all-am'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '.../grap-1.45-1.x86_64/build'
make: *** [Makefile:381: all] Error 2
*** ERROR: make failed

bypass with:

$ cd grap-1.45-1.x86_64/build/
$ ln -s ../src/grap-1.45/examples .
'./examples' -> '../src/grap-1.45/examples'
$ cd ../../

result:

$ cygport grap.cygport compile
...
.../grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll:727:12: error: ‘strdup’ was not
declared in this scope
  char *c = strdup(yytext);
            ^~~~~~
.../grap-1.45-1.x86_64/src/grap-1.45/grap_lex.ll:727:12: note: suggested
alternative: ‘strcmp’
  char *c = strdup(yytext);
            ^~~~~~
            strcmp
grap_lex.cc: In function ‘void yy_init_buffer(YY_BUFFER_STATE, FILE*)’:
grap_lex.cc:3725:48: error: ‘fileno’ was not declared in this scope

                                                ^
grap_lex.cc:3725:48: note: suggested alternative: ‘file’

                                                ^
                                                file
make[1]: *** [Makefile:497: grap_lex.o] Error 1
make[1]: *** Waiting for unfinished jobs....
mv -f .deps/grap_parse.Tpo .deps/grap_parse.Po
mv -f .deps/grap_tokenizer.Tpo .deps/grap_tokenizer.Po
make[1]: Leaving directory '.../grap-1.45-1.x86_64/build'
make: *** [Makefile:381: all] Error 2
*** ERROR: make failed

and this now won't go away even after deleting the generated files and touching
the sources.

Anyone else have suggestions?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list