ncurses: avoid hardcoded assumptions about the layout of .OBJDIR

Abstract out the details of the FreeBSD build into a $TINFO_OBJDIR that
external builds can override if they orchestrate the build a bit
differently and have a different objdir layout as a result.  This makes
the ncurses build a little bit more flexible without requiring weird
backflips.

Reviewed by:	bapt, sjg
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D41834
This commit is contained in:
Kyle Evans 2023-09-12 16:00:45 -05:00
parent e5635c3dab
commit c086d1cbc3
2 changed files with 6 additions and 4 deletions

View file

@ -6,6 +6,8 @@ NCURSES_MAJOR= 6
NCURSES_MINOR= 2
NCURSES_PATCH= 20210220
TINFO_OBJDIR?= ${.OBJDIR:H}/tinfo
CFLAGS+= -D_XOPEN_SOURCE_EXTENDED
NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h
@ -17,7 +19,7 @@ CFLAGS+= -I${.CURDIR:H}/ncurses
CFLAGS+= -I${NCURSES_DIR}/include
CFLAGS+= -I${NCURSES_DIR}/ncurses
CFLAGS+= -I${.OBJDIR:H}/tinfo/
CFLAGS+= -I${TINFO_OBJDIR}
CFLAGS+= -Wall
@ -27,7 +29,7 @@ CFLAGS+= -DHAVE_CONFIG_H
# everyone needs this
.PATH: ${NCURSES_DIR}/include
.PATH: ${.OBJDIR:H}/tinfo/
.PATH: ${TINFO_OBJDIR}
# tools and directories
AWK?= awk

View file

@ -180,9 +180,9 @@ libncursesw.ald: ${.CURDIR}/${STATIC_LDSCRIPT}
-e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \
${.ALLSRC} > ${.TARGET}
lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h
lib_gen.c: MKlib_gen.sh ${TINFO_OBJDIR}/curses.h ncurses_dll.h
LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \
"${AWK}" generated < ${.OBJDIR:H}/tinfo/curses.h >$@
"${AWK}" generated < ${TINFO_OBJDIR}/curses.h >$@
expanded.c: MKexpanded.sh
sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c