Skip to content

Commit

Permalink
derive location of terminfo db from prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
rofl0r committed Mar 6, 2016
1 parent 5fec711 commit aadc2a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ TI_LIBSO=libterminfo/libterminfo$(SO_SUFFIX)
TI_OBJS=$(TI_SRCS:.c=.o)
TI_LOBJS=$(TI_SRCS:.c=.lo)

libterminfo/term.o: CPPFLAGS+=-DINSTALL_PREFIX=\"$(PREFIX)\"
libterminfo/term.lo: CPPFLAGS+=-DINSTALL_PREFIX=\"$(PREFIX)\"

CU_SRCS_=acs.c addbytes.c addch.c addchnstr.c addnstr.c attributes.c \
background.c bell.c border.c box.c chgat.c clear.c clearok.c \
clrtobot.c clrtoeol.c color.c copywin.c cr_put.c \
Expand Down
6 changes: 6 additions & 0 deletions libterminfo/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ __RCSID("$NetBSD: term.c,v 1.19 2015/11/26 01:03:22 christos Exp $");
#include <term.h>
#include <netbsd_sys/endian.h>

#ifndef _PATH_TERMINFO
#ifndef INSTALL_PREFIX
#define _PATH_TERMINFO "/usr/share/misc/terminfo"
#else
#define _PATH_TERMINFO INSTALL_PREFIX "/share/terminfo"
#endif
#endif

static char database[PATH_MAX];
static char pathbuf[PATH_MAX];
Expand Down

0 comments on commit aadc2a6

Please sign in to comment.