Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors on Haiku #42

Closed
roryrjb opened this issue May 1, 2020 · 3 comments
Closed

Build errors on Haiku #42

roryrjb opened this issue May 1, 2020 · 3 comments

Comments

@roryrjb
Copy link
Contributor

roryrjb commented May 1, 2020

Hey, I was just investigating compiling on Haiku for a couple of simple projects I am working on and it doesn't seem straightforward from a lib point of view. Anyway I tried oksh and there are some errors and as you may have the interest and patience (as per #39) I thought I'd share my initial findings and maybe we can somehow figure this out together.

Here's the first issue:

~/Repos/oksh> cc -DEMACS -DVI -w   -c -o edit.o edit.c
edit.c: In function 'x_mode':
edit.c:176:28: error: 'VWERASE' undeclared (first use in this function); did you mean 'VERASE'?
   edchars.werase = cb.c_cc[VWERASE];
                            ^~~~~~~
                            VERASE
edit.c:176:28: note: each undeclared identifier is reported only once for each function it appears in
edit.c:180:11: error: 'VLNEXT' undeclared (first use in this function); did you mean 'LEXIT'?
   cb.c_cc[VLNEXT] = _POSIX_VDISABLE;
           ^~~~~~
           LEXIT
edit.c:182:11: error: 'VDISCARD' undeclared (first use in this function); did you mean 'S_ISCHR'?
   cb.c_cc[VDISCARD] = _POSIX_VDISABLE;
           ^~~~~~~~
           S_ISCHR

...and here's the compiler:

~/Repos/oksh> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/7.3.0/lto-wrapper
Target: x86_64-unknown-haiku
Configured with: /sources/gcc-7.3.0/configure --build=x86_64-unknown-haiku --prefix=/packages/gcc-7.3.0_2018_05_01-3/.self/develop/tools --libexecdir=/packages/gcc-7.3.0_2018_05_01-3/.self/develop/tools/lib --mandir=/packages/gcc-7.3.0_2018_05_01-3/.self/documentation/man --docdir=/packages/gcc-7.3.0_2018_05_01-3/.self/documentation/packages/gcc --enable-threads=posix --disable-nls --enable-shared --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs --enable-languages=c,c++,fortran --enable-lto --enable-frame-pointer --with-pkgversion=2018_05_01 --enable-__cxa-atexit --with-system-zlib --enable-checking=release --with-bug-url=http://dev.haiku-os.org/ --with-default-libstdcxx-abi=gcc4-compatible --enable-libssp --disable-multilib
Thread model: posix
gcc version 7.3.0 (2018_05_01)
@roryrjb
Copy link
Contributor Author

roryrjb commented May 1, 2020

If wrapped those issues in: #ifndef __HAIKU__ and then got the following:

~/Repos/oksh> make
cc -DEMACS -DVI -w   -c -o edit.o edit.c
cc -DEMACS -DVI -w   -c -o emacs.o emacs.c
In file included from sh.h:368:0,
                 from emacs.c:37:
table.h:22:3: error: unknown type name 'int64_t'
   int64_t i; /* integer */
   ^~~~~~~
In file included from sh.h:371:0,
                 from emacs.c:37:
lex.h:112:8: error: unknown type name 'uint32_t'
 extern uint32_t histsize; /* history size */
        ^~~~~~~~
In file included from emacs.c:37:0:
sh.h:445:28: error: unknown type name 'int64_t'; did you mean 'cnt_t'?
 int evaluate(const char *, int64_t *, int, bool);
                            ^~~~~~~
                            cnt_t
sh.h:533:25: error: expected ')' before 'int'
 char * u64ton(uint64_t, int);
                         ^~~
sh.h:589:1: error: unknown type name 'int64_t'; did you mean 'cnt_t'?
 int64_t intval(struct tbl *);
 ^~~~~~~
 cnt_t
sh.h:592:27: error: unknown type name 'int64_t'; did you mean 'cnt_t'?
 void setint(struct tbl *, int64_t);
                           ^~~~~~~
                           cnt_t
sh.h:593:26: error: unknown type name 'int64_t'; did you mean 'cnt_t'?
 int getint(struct tbl *, int64_t *, bool);
                          ^~~~~~~
                          cnt_t
<builtin>: recipe for target 'emacs.o' failed
make: *** [emacs.o] Error 1

@ibara ibara closed this as completed in 9afc5a7 May 1, 2020
@ibara
Copy link
Owner

ibara commented May 1, 2020

Hi. I just committed support for Haiku.

Some caveats:

  1. The fc command requires /bin/ed. I see that HaikuPorts has an ed package, but when I install it, it does not add anything! So you can't use any of the fc features (you can press the up and down arrows to scroll through your history).
  2. The Haiku ncurses package does not seem to include development headers. As a result, ^L to clear the terminal won't work. The external clear command works fine.

@roryrjb
Copy link
Contributor Author

roryrjb commented May 2, 2020

@ibara awesome, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants