open-watcom / open-watcom-v2

Open Watcom V2.0 - Source code repository, Wiki, Latest Binary build, Archived builds including all installers for download.
Other
942 stars 157 forks source link

OpenWatcom fails to compile netbsd-curses #1137

Closed winspool closed 9 months ago

winspool commented 9 months ago

I want to build the Midnight-Commander and that needs a curses implementation. ncurses is to heavy weight, so i tried netbsd-curses first. ( https://github.com/sabotage-linux/netbsd-curses.git )

gcc: builds tcc: builds with a tweak (needs "-L./libterminfo" in the commandline) owcc: build breaks

$ CC="owcc   -I$WATCOM/lh -v "    make
owcc   -I/_v/ow/lh -v  -I. -I./libterminfo -DHAVE_WCHAR -DINSTALL_PREFIX=\"/usr/local\" -DTERMINFO_COMPILE -DTERMINFO_DB -DTERMINFO_COMPAT -I./tic -Werror-implicit-function-declaration -c -o tic/tic.o tic/tic.c
Open Watcom x86 32-bit Compilers Driver Program
Version 2.0 beta Sep 16 2023 17:48:41 (64-bit)
Copyright (c) 2002-2023 The Open Watcom Contributors. All Rights Reserved.
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See https://github.com/open-watcom/open-watcom-v2#readme for details.
    wcc386 -I/_v/ow/lh -I. -I./libterminfo -DHAVE_WCHAR -DINSTALL_PREFIX="/usr/local" -DTERMINFO_COMPILE -DTERMINFO_DB -DTERMINFO_COMPAT -I./tic -Werror-implicit-function-declaration -fo=tic/tic.o -fr tic/tic.c 
Error! E1073: Invalid option '-Werror'
./netbsd_sys/endian.h(10): Error! E1055: Unable to open 'endian.h'
./netbsd_sys/endian.h(13): Error! E1091: erroneus __LITTLE_ENDIAN macro
tic/tic.c(45): Error! E1055: Unable to open 'err.h'
tic/tic.c(47): Error! E1055: Unable to open 'getopt.h'
./libterminfo/term_private.h(295): Warning! W124: Comparison result always 0
./netbsd_sys/emalloc.h(14): Warning! W131: No prototype found for function 'dprintf'
./netbsd_sys/emalloc.h(41): Warning! W131: No prototype found for function 'vasprintf'
./netbsd_sys/queue.h(685): Error! E1156: Assembler error: 'Syntax error'
tic/tic.c(90): Warning! W131: No prototype found for function 'vwarnx'
tic/tic.c(101): Warning! W131: No prototype found for function 'err'
tic/tic.c(141): Error! E1011: Symbol 'ENTRY' has not been declared
tic/tic.c(141): Error! E1009: Expecting ';' but found 'elem'
tic/tic.c(141): Error! E1011: Symbol 'elem' has not been declared
tic/tic.c(141): Error! E1011: Symbol 'elemp' has not been declared
tic/tic.c(141): Error! E1029: Expression must be 'pointer to ...'
tic/tic.c(141): Warning! W111: Meaningless use of an expression
tic/tic.c(143): Error! E1032: Expression for '.' must be a 'structure' or 'union'
tic/tic.c(144): Error! E1032: Expression for '.' must be a 'structure' or 'union'
tic/tic.c(145): Warning! W131: No prototype found for function 'hsearch'
tic/tic.c(145): Error! E1011: Symbol 'FIND' has not been declared
tic/tic.c(146): Error! E1033: Expression for '->' must be 'pointer to struct or union'
tic/tic.c(169): Error! E1011: Symbol 'ENTRY' has not been declared
tic/tic.c(169): Error! E1009: Expecting ';' but found 'elem'
tic/tic.c(169): Error! E1011: Symbol 'elem' has not been declared
tic/tic.c(174): Error! E1032: Expression for '.' must be a 'structure' or 'union'
tic/tic.c(175): Error! E1032: Expression for '.' must be a 'structure' or 'union'
tic/tic.c(176): Error! E1147: Too many errors: compilation aborted
Error: Compiler returned a bad status compiling 'tic/tic.c'
make: *** [GNUmakefile:404: tic/tic.o] Fehler 1

Any ideas?

jmalak commented 9 months ago

Why you use bsd ncurses? it is abandoned tree. Why you don't use System V ncurses which is standard on most *NIX. Anyway you need to port it to OW. OW ncurses is minimal part for terminal support only. It was ported from ncurses V 5.3.

winspool commented 9 months ago

Why you use bsd ncurses? it is abandoned tree.

Oh, i didn't know, that it is abandoned. I tried a pull request this week and got an answer the next day.

Why you don't use System V ncurses which is standard on most *NIX.

I wanted to build MidnightCommander on a remote machine, but ncurses is not installed. To build everything myself on multiple machines, i found issues:

That's why i wanted to try netbsd-curses.

And before i try it remote, i want to test it locally.

Anyway you need to port it to OW.

That's the worst solution. A huge amount of work for every project, and i do not want to maintain forks of a dozen or more projects.

It is much easier to improve OpenWatcom. That will help all affected projects.

But this is only possible, when you allow OpenWatcom to improve in this direction. Please be open for this development direction and accept patches. I learned, that any change in OpenWatcom should be minimal, and i respect that.

OW ncurses is minimal part for terminal support only. It was ported from ncurses V 5.3.

Great to learn that. But when i tried to compile a Program with OpenWatcom a while ago, no curses header was found.

Is the ncurses port only for internal use? I have to recheck, when i'm back at home.

jmalak commented 9 months ago

It is not improvement of OW, it is introducing GNU chaos into OW. If you want to compile GNU application then only solution is GNU tools, because GNU applications are not standard compliant as Microsoft etc. How many GNU applications are ISO-C compliant?

jmalak commented 9 months ago

Anyway I tried to compile ncurses v 6.4 and no problem with owcc and owar (ar librarian). It compiled all files and created libncurses.a static library (150 modules).

winspool commented 9 months ago

Anyway I tried to compile ncurses v 6.4 and no problem with owcc and owar (ar librarian). It compiled all files and created libncurses.a static library (150 modules).

As i wrote before, that is not my issue. I can't compile Midnight-Commander and ncurses on some remote machines. As a possible alternative, i want to try netbsd-curses.

To get more familar with building netbsd-curses, I first tried to build netbsd-curses at home:

jmalak commented 9 months ago

It is your bug, if you read your log you will understand why.

winspool commented 9 months ago

It is not improvement of OW, it is introducing GNU chaos into OW.

Nobody will port any software to the old OpenWatcom. To help developer to use OpenWatcom, the entry level must be as low as possible. That is only possible with an owcc, which is able to handle most of the common used commandline options of gcc/clang.

Oh, do you realize, that the young clang/llvm tootchain did years ago the same, what i try to convince you to follow? They made the entry level as low as possible by using mostly the same commandline options as gcc. (The standard on unix). Not the Windows style MSVC commandline chaos. Any other compiler next to gcc/clang/msvc is used only for special cases/targets, but is no longer relevant as a general purpose compiler.

If you want to compile GNU application then only solution is GNU tools, because GNU applications are not standard compliant as Microsoft etc.

Oh, you talk about the ugliest and broken C compiler, who

And they always try to catch and arrest Programmers into their toolchains by extending them in incompatible, nonstandard ways.

How many GNU applications are ISO-C compliant?

  • Many, but not all. OTOH, most of them are POSIX compilant or BSD compilant.
  • How many Windows Programs are ISO-compilant? Only a few console programs
  • How many ISO-C compilant applications can you compile on Windows? A few

When you mean POSIX applications which are compiled with gcc:

winspool commented 9 months ago

It is your bug, if you read your log you will understand why.

Nope, this Bug has nothing to do with you ability to compile ncurses with OpenWatcom.

Again: I can't compile Midnight-Commander and ncurses on multiple remote machines. OpenWatcom has no support for those machines. I tried OpenWatcom with netbsd-curses on my home machine only to see, in which areas OpenWatcom is lacking features.

When you do not lower the entry level to use OpenWatcom, there will be no relevant Number of new Developers, which will try OpenWatcom and nobody will try to spend Development time to improve OpenWatcom.

There will be never an active community to develop OpenWatcom.

I tried, but failed too often at your blockade.

Even TinyCC is far more advanced and has a bigger active community. We where even contacted from the current ISO C commitee (wg14) lead.

It's too bad, that i wasted such a long time to try to help improving OpenWatcom.

Have a good time with your hobby project as the one and only developer without a community.