dimkr / loksh

A Linux port of OpenBSD's ksh
115 stars 6 forks source link

Won't compile when editing or history is disabled #1

Closed stevenhoneyman closed 9 years ago

stevenhoneyman commented 9 years ago

I'm trying to make a small static compile, so disabled editing modes in config.h settings. Using the latest musl 1.1.4 I get:

musl-gcc -o ksh alloc.o c_ksh.o c_sh.o c_test.o c_ulimit.o edit.o emacs.o eval.o exec.o expr.o history.o io.o jobs.o lex.o mail.o main.o misc.o path.o shf.o syn.o table.o trap.o tree.o tty.o var.o version.o vi.o 
exec.o:exec.c:function execute: error: undefined reference to 'do_selectargs'
main.o:main.c:function shell: error: undefined reference to 'got_sigwinch'
collect2: error: ld returned 1 exit status
Makefile:22: recipe for target 'ksh' failed
make: *** [ksh] Error 1

If I disable history as well, I get lots of warnings, and it stops at this error:

lex.c:193:19: error: ‘history’ undeclared (first use in this function)
        replace = &history[h];
                   ^

It builds OK with just 1 editing mode and no history, but I see there is "NOEDIT" #define so I presume it should compile with these 3 features disabled?

dimkr commented 9 years ago

I haven't tried this even once, since I let it build with the default settings through the makefile. Seems you can't build it without EDIT, because of these two functions.

It's an upstream issue with OpenBSD's ksh and I'm not sure whether fixing this in loksh (a vanilla port) is the right thing to do. What do you think?

stevenhoneyman commented 9 years ago

If it's simple to fix, maybe upstream would accept your patch? It must be designed to build with no emacs/vi/history because at the bottom of the config it checks for NOEDIT and unsets all 3