git: fde3fc69cda8 - main - ncurses: to not create a libncursesw.a in the OBJDIR

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 24 Nov 2021 10:03:49 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=fde3fc69cda865dc65b547411157b3ca7674c5dd

commit fde3fc69cda865dc65b547411157b3ca7674c5dd
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2021-11-24 09:10:26 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2021-11-24 10:02:22 +0000

    ncurses: to not create a libncursesw.a in the OBJDIR
    
    It breaks intree partial builds for every library depending on ncurses
    because ncursesw.a (built without PIC) will be the first the library
    path for the linker to resolve -lncursesw
---
 lib/ncurses/ncurses/Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index af733d3ac613..45c8fcd11301 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -170,9 +170,11 @@ SYMLINKS+=	libncursesw_p.a ${LIBDIR}/libcurses_p.a
 LIBADD+=	tinfow
 SHLIB_LDSCRIPT=	libncursesw.ldscript
 STATIC_LDSCRIPT= libncursesw.aldscript
+CLEANFILES+= libncursesw.ald
+# Keep this for a while to ensure the file is removed during make clean
 CLEANFILES+= libncursesw.a
 
-libncursesw.a: ${.CURDIR}/${STATIC_LDSCRIPT}
+libncursesw.ald: ${.CURDIR}/${STATIC_LDSCRIPT}
 	sed -e 's,@@LIB@@,${LIB},g' \
 	    -e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \
 	    ${.ALLSRC} > ${.TARGET}
@@ -184,11 +186,11 @@ lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h
 expanded.c: MKexpanded.sh
 	sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c
 
-all: ${STATIC_LDSCRIPT} libncursesw.a
+all: ${STATIC_LDSCRIPT} libncursesw.ald
 
-install-libncursesw.a: libncursesw.a
+install-libncursesw.a: libncursesw.ald
 	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-	    ${_INSTALLFLAGS} libncursesw.a ${DESTDIR}${_LIBDIR}/lib${LIB}.a
+	    ${_INSTALLFLAGS} libncursesw.ald ${DESTDIR}${_LIBDIR}/lib${LIB}.a
 
 realinstall: install-libncursesw.a