Index: Mk/Uses/ncurses.mk =================================================================== --- Mk/Uses/ncurses.mk +++ Mk/Uses/ncurses.mk @@ -64,11 +64,11 @@ . endif NCURSES_INSTALLED?= -.if ${NCURSES_INSTALLED} != "" +. if ${NCURSES_INSTALLED} != "" NCURSES_PORT= ${NCURSES_INSTALLED} NCURSES_SHLIBFILE!= ${PKG_INFO} -ql ${NCURSES_INSTALLED} | grep -m 1 "^`pkg query "%p" ${NCURSES_INSTALLED}`/lib/libncurses.so." NCURSES_SHLIBVER?= ${NCURSES_SHLIBFILE:E} -.endif +. endif NCURSES_PORT?= devel/ncurses NCURSES_SHLIBVER?= 6 @@ -76,6 +76,12 @@ BUILD_DEPENDS+= ${LOCALBASE}/lib/libncurses.so.${NCURSES_SHLIBVER}:${PORTSDIR}/${NCURSES_PORT} RUN_DEPENDS+= ${LOCALBASE}/lib/libncurses.so.${NCURSES_SHLIBVER}:${PORTSDIR}/${NCURSES_PORT} NCURSESRPATH= ${NCURSESBASE}/lib +LDFLAGS+= -L${NCURSESRPATH} -Wl,-rpath=${NCURSESRPATH} +CFLAGS+= -I${NCURSESBASE}/include -I${NCURSESINC} + +. if defined(NCURSES_RPATH) +CFLAGS+= -Wl,-rpath,${NCURSESRPATH} +. endif .else .error USES=ncurses only accept 'port' and 'base' as arguments, got ${ncurses_ARGS} @@ -83,9 +89,4 @@ NCURSESLIB= ${NCURSESBASE}/lib -.if defined(NCURSES_RPATH) -CFLAGS+= -Wl,-rpath,${NCURSESRPATH} -.endif -LDFLAGS+= -Wl,-rpath=${NCURSESRPATH} - .endif