Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions Makefile.o2k
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Makefile for less.
# OS/2 version, for klibc+gcc compiler

#### Start of system configuration section. ####

PREFIX = /@unixroot/usr/local
BINDIR = ${PREFIX}/bin
LIBEXECDIR = ${PREFIX}/libexecdir
SYSDIR = ${PREFIX}/etc

CC = gcc
CFLAGS = -g -O2 -Wall -I. \
-DBINDIR=\"${BINDIR}\" -DLIBEXECDIR=\"${LIBEXECDIR}\" \
-DSYSDIR=\"${SYSDIR}\"
LDFLAGS = -Zhigh-mem -Wl,-static
LIBS = -lncurses
O = o

#### End of system configuration section. ####

.SUFFIXES: .c .${O}

# This rule allows us to supply the necessary -D options
# in addition to whatever the user asks for.
.c.${O}:
${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $<

OBJ = \
main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} cvt.${O} decode.${O} edit.${O} evar.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} \
line.${O} linenum.${O} lmsg.$(O) \
lsystem.${O} mark.${O} optfunc.${O} option.${O} opttbl.${O} os.${O} \
output.${O} pattern.${O} position.${O} prompt.${O} search.${O} signal.${O} \
tags.${O} ttyin.${O} version.${O} xbuf.${O}

OBJ += lesskey_parse.${O}

.PHONY: all clean

all: less.exe lessecho.exe

less.exe: ${OBJ}
${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS}

lessecho.exe: lessecho.${O} version.${O}
${CC} ${LDFLAGS} -o $@ lessecho.${O} version.${O} ${LIBS}

${OBJ}: less.h funcs.h defines.h lang.h lmsg.h lessmsg.inc pattern.h xbuf.h

charset.$(O): compose.uni ubin.uni wide.uni
screen.${O} ttyin.${O}: pckeys.h

defines.h: defines.o2k
copy defines.o2k defines.h

clean:
-del *.exe
-del *.$(O)
-del defines.h
17 changes: 12 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -165,26 +165,29 @@ INSTALLATION (MS-DOS systems only,

=======================================================================
INSTALLATION (OS/2 systems only,
with EMX C)
with EMX C or kLIBC C)

1. Move the distributed source to its own directory.

2. Rename Makefile.o2e to Makefile.

3. Check the Makefile to make sure the definitions look ok.

4. If you wish, you may edit defines.o2 to remove some optional features.
4. If you wish, you may edit defines.o2 for EMX or defines.o2k for kLIBC
to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.

5. Type "make" and watch the fun.
5. Type "make" and watch the fun. Ensure that shell used by make should be
cmd.exe compatible.

6. If the make succeeds, it will generate the programs "less.exe" and
"lesskey.exe" in your current directory. Test the generated programs.

7. Make sure you have the emx runtime installed. You need the emx DLLs
emx.dll and emxlibcs.dll and also the termcap database, termcap.dat.
7. Make sure you have the emx runtime or kLIBC runtime installed. You need
the emx DLLs emx.dll and emxlibcs.dll for EMX, or libcn0.dll for kLIBC,
and also the termcap database, termcap.dat.
Make sure you have termcap.dat either in the default location or
somewhere in a directory listed in the PATH or INIT environment
variables.
Expand All @@ -194,6 +197,10 @@ INSTALLATION (OS/2 systems only,
your PATH. scrsize.exe is required only if you use a terminal
emulator such as xterm or rxvt.

9. For kLIBC, if you want to use configure,
type "sh ./configure", "make", and "make install" with setting
MAKESHELL=sh.exe.



=======================================================================
Expand Down
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,19 @@ AH_TOP([
* Pathname separator character.
*/
#define PATHNAME_SEP "\\"
#elif defined(__OS2__)
/*
* Define MSDOS_COMPILER if compiling under Microsoft C.
*/
#define MSDOS_COMPILER 0

/*
* Pathname separator character.
*/
#define PATHNAME_SEP "\\"

/* Settings always true on OS/2. */
#define OS2 1
#else
/*
* Define MSDOS_COMPILER if compiling under Microsoft C.
Expand Down
Loading