vigna / ne

ne, the nice editor
http://ne.di.unimi.it/
GNU General Public License v3.0
474 stars 33 forks source link

Compilation errors on NetBSD (9.2 Stable) #84

Closed trn1ty closed 3 years ago

trn1ty commented 3 years ago

Did not build on NetBSD with the make tool I had:

make: "/home/trinity/src/ne/makefile" line 22: Missing dependency operator
make: "/home/trinity/src/ne/makefile" line 24: Need an operator
make: "/home/trinity/src/ne/makefile" line 26: Need an operator
make: "/home/trinity/src/ne/makefile" line 78: Missing dependency operator
make: "/home/trinity/src/ne/makefile" line 79: warning: duplicate script for target "(,)" ignored
make: "/home/trinity/src/ne/makefile" line 23: warning: using previous script for "(,)" defined here
make: "/home/trinity/src/ne/makefile" line 80: Need an operator
make: "/home/trinity/src/ne/makefile" line 92: Missing dependency operator
make: "/home/trinity/src/ne/makefile" line 93: warning: duplicate script for target "ifneq" ignored
make: "/home/trinity/src/ne/makefile" line 79: warning: using previous script for "ifneq" defined here
make: "/home/trinity/src/ne/makefile" line 93: warning: duplicate script for target "(,)" ignored
make: "/home/trinity/src/ne/makefile" line 23: warning: using previous script for "(,)" defined here
make: "/home/trinity/src/ne/makefile" line 94: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /home/trinity/src/ne

I tried with gmake (the GNU version of make) and had the same issue:

( cd doc; make )
( cd src; make clean; make NE_GLOBAL_DIR=/usr/local/share/ne; strip ne )
make[1]: "/home/trinity/src/ne/src/makefile" line 93: Missing dependency operator
make[1]: "/home/trinity/src/ne/src/makefile" line 95: Need an operator
make[1]: "/home/trinity/src/ne/src/makefile" line 98: Missing dependency operator
make[1]: "/home/trinity/src/ne/src/makefile" line 101: Need an operator
make[1]: Fatal errors encountered -- cannot continue
make[1]: stopped in /home/trinity/src/ne/src
make[1]: "/home/trinity/src/ne/src/makefile" line 93: Missing dependency operator
make[1]: "/home/trinity/src/ne/src/makefile" line 95: Need an operator
make[1]: "/home/trinity/src/ne/src/makefile" line 98: Missing dependency operator
make[1]: "/home/trinity/src/ne/src/makefile" line 101: Need an operator
make[1]: Fatal errors encountered -- cannot continue
make[1]: stopped in /home/trinity/src/ne/src
strip: 'ne': No such file
gmake: *** [makefile:30: build] Error 1

Does anyone have an idea as to what's wrong here?

utoddl commented 3 years ago

Looks like your make(s) don't understand constructions like

ifeq ($(OS), Windows_NT)
        OS := Windows
else
        OS := $(shell uname -s)
endif

There are three of those ifeq ($(OS), ... sections in the top-level makefile. Since you know your OS isn't Windows_NT, Windows, or Darwin, it should be pretty clear what small snippets of the makefile you need to remove to make it work on NetBSD.

Which version of gmake do you have? (gmake -v)

trn1ty commented 3 years ago

Hmmm... GNU Make 4.2.1. Looks like the latest is 4.3... could that be the problem?

Deleted the Windows/macOS lines in ./makefile and commented out some lines in ./src/makefile (93-95, 98, 101 - I left the GCCFLAGS and LDFLAGS in because my system C compiler is gcc) but now I get this:

ld: /usr/lib/crt0.o: in function `___start':
(.text+0x2e9): undefined reference to `main'

This happens whether or not I comment out line 100 (LDFLAGS). I'm out of my domain of knowledge here so sorry if the solution is something obvious!

utoddl commented 3 years ago

Something obvious? I wish. But staring at src/makefile, ld should have a reference to main coming from ne.o, so... Hmm.

In the src directory, do a make clean, then try a make. If it still fails the same way, do another make clean followed by make -n and post the results. (Or do those make invocations need to be gmake?) Sorry this is rather vague. It's strange enough doing this on a local machine. Figuring it out through email/github will test one's patience.