CMB / edbrowse

A command-line editor and web browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

edbrowse doesn't compile on Termux

OParczyk opened this issue · comments

Hi! I tried to compile edbrowse from source for Termux, as there is no package available as of now. When I do, I get the following errors:
$ make cd src ; make make[1]: Entering directory '/data/data/com.termux/files/home/edbrowse/edbrowse/src' cc -DEDBROWSE_ON_LINUX -Wall -D_FILE_OFFSET_BITS=64 -c -o main.o main.c In file included from main.c:6: ./eb.h:518:2: error: unknown type name 'ushort' ushort bits; /* a bun... ^ main.c:151:2: warning: implicit declaration of function 'pthread_setcancelstate' is invalid in C99 [-Wimplicit-function-declaration] pthread_setcancelstate(PTHREAD_C... ^ main.c:151:25: error: use of undeclared identifier 'PTHREAD_CANCEL_ENABLE' pthread_setcancelstate(PTHREAD_C... ^ main.c:153:2: warning: implicit declaration of function 'pthread_setcanceltype' is invalid in C99 [-Wimplicit-function-declaration] pthread_setcanceltype(PTHREAD_CA... ^ main.c:153:24: error: use of undeclared identifier 'PTHREAD_CANCEL_ASYNCHRONOUS' pthread_setcanceltype(PTHREAD_CA... ^ main.c:156:2: warning: implicit declaration of function 'pthread_cancel' is invalid in C99 [-Wimplicit-function-declaration] pthread_cancel(t1); ^ 3 warnings and 3 errors generated. make[1]: * [<builtin>: main.o] Error 1 make[1]: Leaving directory '/data/data/com.termux/files/home/edbrowse/edbrowse/src' make: * [makefile:5: all] Error 2

When I #define ushort unsigned short in eb.h it becomes
$ make cd src ; make make[1]: Entering directory '/data/data/com.termux/files/home/edbrowse/edbrowse/src' cc -DEDBROWSE_ON_LINUX -Wall -D_FILE_OFFSET_BITS=64 -c -o main.o main.c main.c:152:2: warning: implicit declaration of function 'pthread_setcancelstate' is invalid in C99 [-Wimplicit-function-declaration] pthread_setcancelstate(PTHREAD_C... ^ main.c:152:25: error: use of undeclared identifier 'PTHREAD_CANCEL_ENABLE' pthread_setcancelstate(PTHREAD_C... ^ main.c:154:2: warning: implicit declaration of function 'pthread_setcanceltype' is invalid in C99 [-Wimplicit-function-declaration] pthread_setcanceltype(PTHREAD_CA... ^ main.c:154:24: error: use of undeclared identifier 'PTHREAD_CANCEL_ASYNCHRONOUS' pthread_setcanceltype(PTHREAD_CA... ^ main.c:157:2: warning: implicit declaration of function 'pthread_cancel' is invalid in C99 [-Wimplicit-function-declaration] pthread_cancel(t1); ^ 3 warnings and 2 errors generated. make[1]: * [<builtin>: main.o] Error 1 make[1]: Leaving directory '/data/data/com.termux/files/home/edbrowse/edbrowse/src' make: * [makefile:5: all] Error 2

How do I fix this?

Thanks to all of you for your interest!

When trying to compile with this branch I still have to #define ushort unsigned short in eb.h manually and get this error when I do:

html-tidy.c:14:10: fatal error: 'tidy.h' file
not found
#include <tidy.h>
^~~~~~~~
1 error generated.
make[1]: * [: html-tidy.o] Error 1
make: * [makefile:5: all] Error 2

and several complaints like

html.c:2884:9: warning: implicit declaration of
function 'pthread_tryjoin_np' is invalid
in C99 [-Wimplicit-function-declaration]

Thanks! installed tidy and duktape now and it dies with

/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: html.o: in function runTimer':
html.c:(.text+0x755c): undefined reference to pthread_tryjoin_np'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: html.c:(.text+0x7560): undefined reference to pthread_tryjoin_np'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: stringfile.o: in function envFile':
stringfile.c:(.text+0x3944): undefined reference to glob'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: stringfile.c:(.text+0x3a28): undefined reference to globfree'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: stringfile.c:(.text+0x3a50): undefined reference to globfree'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: stringfile.c:(.text+0x3a8c): undefined reference to globfree'
/data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: stringfile.c:(.text+0x3ab0): undefined reference to `globfree'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: * [GNUmakefile:75: edbrowse] Error 1
make: * [makefile:5: all] Error 2

I'd guess that's related to the last thing you mentioned.

So after linking libduktape.so to libduktape.so.1 and adding the flags I get greeted by the obligatory

.ebrc: unrecognized keyword linelength at line 49
edbrowse ready

so I guess that works now.
Leaving that here for future reference:
LDFLAGS=-landroid-glob make

Thanks for your help!

Hi! Sorry for my very late comment, but I think you've missed a hardcoded /tmp (cannot create temporary directory /tmp/.edbrowse)

@martinetd seems to have fixed this on his branch (also he mentioned it in a previous comment)

~ Oliver Parczyk

Works fine now, thank you for dealing w/ this issue!