Skip to content

Commit

Permalink
Support building natively on OS/400 (PASE for IBM i)
Browse files Browse the repository at this point in the history
Verified using PASE for IBM i 7.5 with GCC 10.5 (gcc10)
and ncurses 6.0 (ncurses, ncurses-devel) packages.

Signed-off-by: Jeffrey H. Johnson <[email protected]>
  • Loading branch information
johnsonjh committed May 21, 2024
1 parent db2dc64 commit 84d6a84
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
OpenVi 7.5.28 -> OpenVi 7.5.29-dev: Tue May 21 02:11:09 2024
OpenVi 7.5.28 -> OpenVi 7.5.29: Tue May 21 05:26:38 2024
+ Support building natively on OS/400; verified using PASE for IBM i
7.5 with GCC 10.5 (gcc10) and ncurses 6.0 (ncurses, ncurses-devel)
+ Add a new output level, M_XINFO, which outputs an informational
message and ignores the state of the verbose and silent flags
+ Show version command output even in ex silent mode
Expand Down
13 changes: 11 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ ifeq ($(OS),sunos)
_SUNOS = 1
endif # sunos

ifeq ($(OS),os400)
_OS400 = 1
OS = aix
endif # os400

###############################################################################

ifeq ($(OS),solaris)
Expand Down Expand Up @@ -113,9 +118,13 @@ ifeq ($(OS),netbsd)
else # !netbsd
CURSESLIB ?= -lncurses
endif # netbsd
ifeq ($(OS),aix)
ifeq ($(OS),aix) # aix/os400
MAIXBITS ?= $(shell command -p $(GETCONF) KERNEL_BITMODE 2> /dev/null || \
$(PRINTF) '%s' "32")
ifeq ($(_OS400),1) # IBM i (OS/400) PASE
CFLAGS += -I/QOpenSys/pkgs/include/ncurses
LDFLAGS += -lutil -L/QOpenSys/pkgs/lib
endif
ifneq (,$(findstring gcc,$(CC))) # gcc (GNU C)
CFLAGS += $(WFLAGS) -maix$(MAIXBITS)
LDFLAGS += -maix$(MAIXBITS) -Wl,-b$(MAIXBITS)
Expand All @@ -132,7 +141,7 @@ ifeq ($(OS),aix)
LDFLAGS += -L/opt/freeware/lib
CFLAGS += -I/opt/freeware/include
LINKLIBS ?= -lbsd $(CURSESLIB) -lcurses
else # !aix
else # !aix/os400
ifeq ($(OS),solaris)
CFLAGS += -U__EXTENSIONS__ -D_XPG4_2 -D__solaris__ -D_REENTRANT \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
Expand Down
2 changes: 1 addition & 1 deletion ex/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
# define _VERSION_H

# define VI_VERSION \
"Version 7.5.29-dev (OpenVi) 04/25/2024"
"Version 7.5.29 (OpenVi) 04/25/2024"

#endif /* ifndef _VERSION_H */

0 comments on commit 84d6a84

Please sign in to comment.