diff -u -urw support/shobj-conf support/shobj-conf --- support/shobj-conf 2016-10-05 22:02:11 +0000 +++ support/shobj-conf 2019-05-07 14:13:40 +0000 @@ -398,21 +398,17 @@ ;; hpux11*) - SHOBJ_STATUS=unsupported - SHLIB_STATUS=unsupported - - # If you are using the HP ANSI C compiler, you can uncomment and use - # this code (I have not tested it) -# SHOBJ_STATUS=supported -# SHLIB_STATUS=supported -# -# SHOBJ_CFLAGS='+z' -# SHOBJ_LD='ld' -# SHOBJ_LDFLAGS='-b +s +h $@' + SHOBJ_STATUS=supported + SHLIB_STATUS=supported # -# SHLIB_XLDFLAGS='+b $(libdir)' -# SHLIB_LIBSUFF='sl' -# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + SHOBJ_CFLAGS='+z' + SHOBJ_LD='$(CC)' + SHOBJ_LDFLAGS='-b -Wl,+s -Wl,+h,$@' + + SHLIB_XLDFLAGS='-Wl,+b,$(libdir)' + SHLIB_LIBSUFF='so' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' + SHLIB_LIBS='$(TERMCAP_LIB)' ;; diff -u -urw tcap.h tcap.h --- tcap.h 2016-01-25 16:36:15 +0000 +++ tcap.h 2019-08-28 09:32:49 +0000 @@ -41,6 +41,14 @@ # undef PC #endif +#if defined(__hpux) +#define TGETENT_OK 0 +#define TGETFLAG_OK 0 +#else +#define TGETENT_OK 1 +#define TGETFLAG_OK 1 +#endif + extern char PC; extern char *UP, *BC; diff -u -urw terminal.c terminal.c --- terminal.c 2018-10-29 15:56:27 +0000 +++ terminal.c 2019-08-28 09:46:07 +0000 @@ -483,7 +483,7 @@ tgetent_ret = tgetent (term_buffer, term); } - if (tgetent_ret <= 0) + if (tgetent_ret != TGETENT_OK) { FREE (term_string_buffer); FREE (term_buffer); @@ -544,7 +544,8 @@ if (!_rl_term_cr) _rl_term_cr = "\r"; - _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn"); + _rl_term_autowrap = (tgetflag ("am") == TGETFLAG_OK) + && (tgetflag ("xn") == TGETFLAG_OK); /* Allow calling application to set default height and width, using rl_set_screen_size */ @@ -559,7 +560,7 @@ /* Check to see if this terminal has a meta key and clear the capability variables if there is none. */ - term_has_meta = tgetflag ("km") != 0; + term_has_meta = (tgetflag ("km") == TGETFLAG_OK); if (term_has_meta == 0) _rl_term_mm = _rl_term_mo = (char *)NULL; #endif /* !__MSDOS__ */