diff --git a/c/Mf-a6fb b/c/Mf-a6fb index 9a55d7ae89..8e37cda54a 100644 --- a/c/Mf-a6fb +++ b/c/Mf-a6fb @@ -17,7 +17,7 @@ m = a6fb Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-a6le b/c/Mf-a6le index c6b9b93389..222c065370 100644 --- a/c/Mf-a6le +++ b/c/Mf-a6le @@ -16,7 +16,7 @@ m = a6le Cpu = X86_64 -mdclib = -lm -ldl -lncurses -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lrt C = ${CC} ${CPPFLAGS} -m64 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-a6ob b/c/Mf-a6ob index 03ab059065..c38031af0f 100644 --- a/c/Mf-a6ob +++ b/c/Mf-a6ob @@ -17,7 +17,7 @@ m = a6ob Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-a6osx b/c/Mf-a6osx index 8293937baa..1362491a7e 100644 --- a/c/Mf-a6osx +++ b/c/Mf-a6osx @@ -16,7 +16,7 @@ m = a6osx Cpu = X86_64 -mdclib = -liconv -lm -lncurses +mdclib = -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-a6s2 b/c/Mf-a6s2 index 6d172cc73b..00833c428e 100644 --- a/c/Mf-a6s2 +++ b/c/Mf-a6s2 @@ -16,7 +16,7 @@ m = a6s2 Cpu = X86_64 -mdclib = -lnsl -ldl -lm -lcurses -lrt +mdclib = -lnsl -ldl -lm $(LIBCURSES) -lrt C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wextra -Werror -O ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-arm32le b/c/Mf-arm32le index c4564a5264..291c88921b 100644 --- a/c/Mf-arm32le +++ b/c/Mf-arm32le @@ -16,7 +16,7 @@ m = arm32le Cpu = ARMV6 -mdclib = -lm -ldl -lncurses -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lrt C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -Wno-implicit-fallthrough -O2 ${CFLAGS} o = o mdsrc = arm32le.c diff --git a/c/Mf-base b/c/Mf-base index cc23047ba7..83c5e07ffb 100644 --- a/c/Mf-base +++ b/c/Mf-base @@ -28,7 +28,7 @@ kernelsrc=statics.c segment.c alloc.c symbol.c intern.c gcwrapper.c gc-ocd.c gc- kernelobj=${kernelsrc:%.c=%.$o} ${mdobj} -kernelhdr=system.h types.h version.h globals.h externs.h segment.h gc.c sort.h thread.h config.h itest.c +kernelhdr=system.h types.h version.h globals.h externs.h segment.h gc.c sort.h thread.h config.h itest.c nocurses.h mainsrc=main.c @@ -51,7 +51,7 @@ endif scheme.o: itest.c scheme.o main.o: config.h -${kernelobj}: system.h types.h version.h externs.h globals.h segment.h thread.h sort.h +${kernelobj}: system.h types.h version.h externs.h globals.h segment.h thread.h sort.h nocurses.h ${kernelobj}: ${Include}/equates.h ${Include}/scheme.h ${mainobj}: ${Include}/scheme.h ${kernelobj}: ../zlib/zconf.h ../zlib/zlib.h diff --git a/c/Mf-i3fb b/c/Mf-i3fb index 834d8ab846..b76a285881 100644 --- a/c/Mf-i3fb +++ b/c/Mf-i3fb @@ -17,7 +17,7 @@ m = i3fb Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-i3le b/c/Mf-i3le index 9d3b30db49..732092a4e8 100644 --- a/c/Mf-i3le +++ b/c/Mf-i3le @@ -16,7 +16,7 @@ m = i3le Cpu = I386 -mdclib = -lm -ldl -lncurses -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lrt C = ${CC} ${CPPFLAGS} -m32 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -fno-stack-protector ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-i3ob b/c/Mf-i3ob index ee9ceec21b..2d1bed20dd 100644 --- a/c/Mf-i3ob +++ b/c/Mf-i3ob @@ -17,7 +17,7 @@ m = i3ob Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-i3osx b/c/Mf-i3osx index 8ca333d76d..e6bd3c9dd1 100644 --- a/c/Mf-i3osx +++ b/c/Mf-i3osx @@ -16,7 +16,7 @@ m = i3osx Cpu = I386 -mdclib = -liconv -lm -lncurses +mdclib = -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -msse2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-i3qnx b/c/Mf-i3qnx index 25c24fd5ce..a3d5aed1ac 100644 --- a/c/Mf-i3qnx +++ b/c/Mf-i3qnx @@ -16,7 +16,7 @@ m = i3qnx Cpu = I386 -mdclib = -lm /usr/local/lib/libiconv.so -lsocket -lncurses +mdclib = -lm /usr/local/lib/libiconv.so -lsocket $(LIBNCURSES) C = qcc ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -O2 -N2048K ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-i3s2 b/c/Mf-i3s2 index 7f2c52963d..b7ec489f8a 100644 --- a/c/Mf-i3s2 +++ b/c/Mf-i3s2 @@ -16,7 +16,7 @@ m = i3s2 Cpu = I386 -mdclib = -lnsl -ldl -lm -lcurses -lrt +mdclib = -lnsl -ldl -lm $(LIBCURSES) -lrt C = ${CC} ${CFLAGS} -m32 -Wpointer-arith -Wextra -Werror -O ${CPPFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ppc32le b/c/Mf-ppc32le index bf209fb233..30f2214b5f 100644 --- a/c/Mf-ppc32le +++ b/c/Mf-ppc32le @@ -16,7 +16,7 @@ m = ppc32le Cpu = PPC32 -mdclib = -lm -ldl -lncurses -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lrt C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -Wno-implicit-fallthrough -O2 ${CFLAGS} o = o mdsrc = ppc32.c diff --git a/c/Mf-ta6fb b/c/Mf-ta6fb index 81800dcacc..5033552533 100644 --- a/c/Mf-ta6fb +++ b/c/Mf-ta6fb @@ -17,7 +17,7 @@ m = ta6fb Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses -lpthread +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ta6le b/c/Mf-ta6le index 206afc5070..6be72728d5 100644 --- a/c/Mf-ta6le +++ b/c/Mf-ta6le @@ -16,7 +16,7 @@ m = ta6le Cpu = X86_64 -mdclib = -lm -ldl -lncurses -lpthread -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lpthread -lrt C = ${CC} ${CPPFLAGS} -m64 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ta6ob b/c/Mf-ta6ob index 45e29e8955..68acdf9665 100644 --- a/c/Mf-ta6ob +++ b/c/Mf-ta6ob @@ -17,7 +17,7 @@ m = ta6ob Cpu = X86_64 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses -lpthread +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ta6osx b/c/Mf-ta6osx index 9626f36489..f0ac3451c1 100644 --- a/c/Mf-ta6osx +++ b/c/Mf-ta6osx @@ -16,7 +16,7 @@ m = ta6osx Cpu = X86_64 -mdclib = -liconv -lm -lncurses +mdclib = -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ta6s2 b/c/Mf-ta6s2 index ed260d054c..f219b9b270 100644 --- a/c/Mf-ta6s2 +++ b/c/Mf-ta6s2 @@ -16,7 +16,7 @@ m = ta6s2 Cpu = X86_64 -mdclib = -lnsl -ldl -lm -lpthread -lcurses -lrt +mdclib = -lnsl -ldl -lm -lpthread $(LIBCURSES) -lrt C = ${CC} ${CPPFLAGS} -m64 -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ti3fb b/c/Mf-ti3fb index 58af09cfcd..448bde6b22 100644 --- a/c/Mf-ti3fb +++ b/c/Mf-ti3fb @@ -17,7 +17,7 @@ m = ti3fb Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses -lpthread +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread C = ${CC} ${CPPFLAGS} -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ti3le b/c/Mf-ti3le index 388360282b..56462a213c 100644 --- a/c/Mf-ti3le +++ b/c/Mf-ti3le @@ -16,7 +16,7 @@ m = ti3le Cpu = I386 -mdclib = -lm -ldl -lncurses -lpthread -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lpthread -lrt C = ${CC} ${CPPFLAGS} -m32 -msse2 -Wpointer-arith -Wall -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ti3ob b/c/Mf-ti3ob index b6b529fd91..c9ebb50795 100644 --- a/c/Mf-ti3ob +++ b/c/Mf-ti3ob @@ -17,7 +17,7 @@ m = ti3ob Cpu = I386 mdinclude = -I/usr/local/include -I/usr/X11R6/include -mdclib = -L/usr/local/lib -liconv -lm -lncurses -lpthread +mdclib = -L/usr/local/lib -liconv -lm $(LIBNCURSES) -lpthread C = ${CC} ${CPPFLAGS} -Wpointer-arith -Werror -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ti3osx b/c/Mf-ti3osx index f78817db7d..1dfeba7a1e 100644 --- a/c/Mf-ti3osx +++ b/c/Mf-ti3osx @@ -16,7 +16,7 @@ m = ti3osx Cpu = I386 -mdclib = -liconv -lm -lncurses +mdclib = -liconv -lm $(LIBNCURSES) C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough -Werror -O2 -msse2 -I/opt/X11/include/ ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-ti3s2 b/c/Mf-ti3s2 index 2f9ec15e5f..63da1be12d 100644 --- a/c/Mf-ti3s2 +++ b/c/Mf-ti3s2 @@ -16,7 +16,7 @@ m = ti3s2 Cpu = I386 -mdclib = -lnsl -ldl -lm -lpthread -lcurses -lrt +mdclib = -lnsl -ldl -lm -lpthread $(LIBCURSES) -lrt C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -O2 -D_REENTRANT ${CFLAGS} o = o mdsrc = i3le.c diff --git a/c/Mf-tppc32le b/c/Mf-tppc32le index c888664fe1..42dbfa11a8 100644 --- a/c/Mf-tppc32le +++ b/c/Mf-tppc32le @@ -16,7 +16,7 @@ m = tppc32le Cpu = PPC32 -mdclib = -lm -ldl -lncurses -lpthread -lrt +mdclib = -lm -ldl $(LIBNCURSES) -lpthread -lrt C = ${CC} ${CPPFLAGS} -m32 -Wpointer-arith -Wextra -Werror -Wno-implicit-fallthrough -O2 -D_REENTRANT -pthread ${CFLAGS} o = o mdsrc = ppc32le.c diff --git a/c/expeditor.c b/c/expeditor.c index 78f6be3bfb..40c9b72f67 100644 --- a/c/expeditor.c +++ b/c/expeditor.c @@ -527,7 +527,9 @@ static void s_ee_write_char(wchar_t c) { } #else /* WIN32 */ -#ifdef SOLARIS +#ifdef DISABLE_CURSES +#include "nocurses.h" +#elif defined(SOLARIS) #define NCURSES_CONST #define CHTYPE int #include diff --git a/c/nocurses.h b/c/nocurses.h new file mode 100644 index 0000000000..4b17450243 --- /dev/null +++ b/c/nocurses.h @@ -0,0 +1,24 @@ +#ifndef ERR +# define ERR -1 +#endif + +#define setupterm(a, b, e) (*(e) = 0, ERR) +#define tputs(c, x, f) (f(c)) + +#define lines 0 +#define columns 0 + +#define cursor_left 0 +#define cursor_right 0 +#define cursor_up 0 +#define cursor_down 0 +#define enter_am_mode 0 +#define exit_am_mode 0 +#define clr_eos 0 +#define clr_eol 0 +#define clear_screen 0 +#define carriage_return 0 +#define bell 0 +#define scroll_reverse 0 +#define auto_right_margin 0 +#define eat_newline_glitch 0 diff --git a/configure b/configure index edbb9a544e..f26066054b 100755 --- a/configure +++ b/configure @@ -38,6 +38,7 @@ installschemename="scheme" installpetitename="petite" installscriptname="scheme-script" disablex11=no +disablecurses=no : ${CC:="gcc"} : ${CPPFLAGS:=""} : ${CFLAGS:=""} @@ -204,6 +205,9 @@ while [ $# != 0 ] ; do --disable-x11) disablex11=yes ;; + --disable-curses) + disablecurses=yes + ;; CC=*) CC=`echo $1 | sed -e 's/^CC=//'` ;; @@ -385,9 +389,20 @@ if [ "$disablex11" = "yes" ]; then echo '#define DISABLE_X11' >> $w/c/config.h fi +LIBCURSES=-lcurses +LIBNCURSES=-lncurses + +if [ "$disablecurses" = "yes" ]; then + echo '#define DISABLE_CURSES' >> $w/c/config.h + LIBCURSES= + LIBNCURSES= +fi + cat > $w/c/Mf-config << END CC=$CC CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS +LIBCURSES=$LIBCURSES +LIBNCURSES=$LIBNCURSES END